在Xcode中找不到编译问题时遇到问题。我得到的错误是Expected ']' before ';' token
丢失方括号问题
你能帮我找到问题吗?
这是在执行文件的方法:
- (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);
}
提前感谢!
你能解释为什么(2)? – DMan 2011-04-04 23:30:01
当然 - “NSLog()”的第一个参数是格式字符串。任何包含的'%'序列都将被解释。尝试打印'NSLog(@“%@%@%@”)';它会崩溃。如果你的字符串碰巧有任何随机的'%'序列,它会导致类似的崩溃。 – bbum 2011-04-05 00:03:51