• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Warning about comparison between pointer and integer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Warning about comparison between pointer and integer
      • From: "email@hidden" <email@hidden>
    • Re: Warning about comparison between pointer and integer
      • From: Fritz Anderson <email@hidden>
    • Re: Warning about comparison between pointer and integer
      • From: Scott Ribe <email@hidden>
    • Re: Warning about comparison between pointer and integer
      • From: Dave Carrigan <email@hidden>
  • Prev by Date: Notification based toolbar design pattern
  • Next by Date: Cannot use malloc debug
  • Previous by thread: Notification based toolbar design pattern
  • Next by thread: Re: Warning about comparison between pointer and integer
  • Index(es):
    • Date
    • Thread