开发者

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];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜