Warning about comparison between pointer and integer
Warning about comparison between pointer and integer
- Subject: Warning about comparison between pointer and integer
- From: "Eric E. Dolecki" <email@hidden>
- Date: Wed, 16 Dec 2009 11:18:48 -0500
I am using NSUserDefaults to store some data. On first run of the
application, I check for the data, and if it's not been set already, I set
it.
I however get warnings in my code. In my .h I set up my variables, and then
in my .m:
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
alarm1_hour = [prefs integerForKey:@"alarm1Hour"];
if( alarm1_hour == NULL ){
NSLog(@"alarm 1 hour is null" );
}
Should I use a temporary variable to check instead of the variable with the
pointer? Or are these warnings okay to ignore?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden