How to pass data to IBAPickListFormField?

87 views
Skip to first unread message

Costa

unread,
Sep 19, 2011, 9:04:21 AM9/19/11
to IBAForms
I am having difficulties passing the saved NSString data to the
IBAPickListFormField.
All the other form field types seem to work OK (incl. Date Picker).
I tried setting it directly, tried thru Core Data model binding, the
result is the same: it crashes on the function that is returning the
NSString value, even setting the label yields the same.


- (NSString *)formFieldStringValue
{
NSString *value = nil;

if (self.formFieldValue != nil)
{
NSMutableArray *itemNames = [[[NSMutableArray alloc] init]
autorelease];

for (id<IBAPickListOption> item in [self pickListOptions])
{
NSString *itemName = [item name];
if (([[self formFieldValue] containsObject:item]) &&
(itemName.length > 0)) //crash
{
[itemNames addObject:itemName];
}
}

value = [itemNames componentsJoinedByString:@", "];
}

return value;
}


Am I doing something wrong?

Sadat Rahman

unread,
Sep 19, 2011, 8:25:36 PM9/19/11
to ibaf...@googlegroups.com

On 19/09/2011, at 11:04 PM, Costa wrote:

> I am having difficulties passing the saved NSString data to the
> IBAPickListFormField.
> All the other form field types seem to work OK (incl. Date Picker).
> I tried setting it directly, tried thru Core Data model binding, the
> result is the same: it crashes on the function that is returning the
> NSString value, even setting the label yields the same.


Set breakpoints within your pick list value transformer, and see how you go from there.

Costa Pinchuk

unread,
Sep 19, 2011, 9:27:41 PM9/19/11
to ibaf...@googlegroups.com
I did. I found the answer in another topic.

Frankly, I find it strange if a property whose value is stored as String cannot be passed a String as a parameter.

Wenbo Shi

unread,
Nov 10, 2012, 2:12:09 AM11/10/12
to ibaf...@googlegroups.com
Hi,

I'm having the same problem to set the initial value for IBAPickListFormField. Can you show me how you solved it? 

Thank you very much.

Wenbo
Reply all
Reply to author
Forward
0 new messages