开发者

initialization makes pointer from integer without a cast

So my code is this

int theTime = [timeEnter.text intValue]; 

Why does that 开发者_如何转开发return the error?

initialization makes pointer from integer without a cast

Thanks.


Try

NSInteger theTime = [timeEnter.text intValue]; 

If this doesn't work, check out the text and make sure it really is an integer e.g. write it to the console with

NSLog(@"%@",timeEnter.text);


I tried the same thing, it works fine, just make sure that you have an integer value in the timeEnter.text (I'm guessing it's a textbox)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜