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)
精彩评论