SIMPLE: Adding in Xcode?
Here's some of my code.
When I开发者_StackOverflow社区 try to echo i
, the app crashes.
What's the problem with the code?
int i=0;
for (NSDictionary *rowthree in resultsthree) {
i++;
testLabel.text = i;
}
Thanks.
The code sample is pretty minimal, but at a guess: You can't directly set testLabel.text = i
, since text
is an instance of NSString, not an integer. You probably meant:
testLabel.text = [NSString stringWithFormat:@"%d", i];
精彩评论