0

我想按标题设置 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];
4

0 回答 0