【发布时间】:2009-11-18 14:18:41
【问题描述】:
我正在做一个带有 UIPickerView 的 Iphone 应用程序。选择器视图有两列包含 NSString。 我有一个按钮,它生成一个 NSString,其中包含 PickerView 中两列的选定值并将其打印在日志中。
问题是即使我更改了选定的值,它也只会打印选择器视图中的前两项。
我还收到一个警告,“格式不是字符串文字,也没有格式参数”。即使我检查了谷歌的线索,我也不知道。
这里是按钮操作的代码:
- (IBAction) sendButtonTapped:(id)sender{
NSString* theMessage = [NSString stringWithFormat:@"I'm %@ and feeling %@ about it.",
[activities objectAtIndex:[tweetPicker selectedRowInComponent:0]],
[feelings objectAtIndex:[tweetPicker selectedRowInComponent:1]]];
NSLog(theMessage);
}
【问题讨论】:
标签: iphone objective-c cocoa-touch uipickerview