UIPicker按标题设置选定的行

时间:2013-09-11 07:51:59

标签: iphone objective-c xcode ios5 ios4

我想按标题设置UIPicker,我使用下面的代码,但它不起作用,我缺少什么?

// data from sqlite db

test2 =[[NSString alloc]
                    initWithUTF8String:
                    (const char *) sqlite3_column_text(statement, 1)];


NSLog(@"%@", test2); // 400 (the value)
[self.myPickerView selectRow:[[[NSUserDefaults 
    standardUserDefaults]objectForKey:test2]intValue] inComponent:0 animated:YES];

0 个答案:

没有答案