Wednesday, 11 September 2013

UIPicker set selected row by title

UIPicker set selected row by title

i would like to set UIPicker selected row by title, i'm using the code
below, but it's not working, what I'm missing? Many Many Thanks.
// data from sqlite db
test2 =[[NSString alloc]
initWithUTF8String:
(const char *) sqlite3_column_text(statement, 1)];
NSLog(@"%@", test2); // 400
[self.myPickerView selectRow:[[[NSUserDefaults
standardUserDefaults]objectForKey:test2]intValue] inComponent:0
animated:YES];

No comments:

Post a Comment