• 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
Re: NSUserdefaultsController warning
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSUserdefaultsController warning


  • Subject: Re: NSUserdefaultsController warning
  • From: Lorenzo Thurman <email@hidden>
  • Date: Fri, 20 Jul 2007 20:51:50 -0500

Thanks, I just applied a cast.

On Jul 20, 2007, at 9:48 a, ∞ wrote:


Il giorno 20/lug/07, alle ore 16:34, Lorenzo Thurman ha scritto:

The methods have different signatures, so why do I get this warning?

To overcome some rare compiler idiocy, +sharedUserDefaultsController returns a result of type (id), which means that the compiler cannot choose what -save: method you are actually calling. The solution is casting the return value of + sharedUserDefaultsController or the IMHO more readable:


NSUserDefaultsController* uc = [NSUserDefaultsController sharedUserDefaultsController];
[uc save:self]; // uc has the correct type information (NSUserDefaultsController*) and therefore works.


- ∞

"The greatest dangers to liberty lurk in insidious encroachment by men of zeal - well-meaning but without understanding."
--Justice Louis D. Brandeis


Lorenzo Thurman
email@hidden


_______________________________________________

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


References: 
 >NSUserdefaultsController warning (From: "Lorenzo Thurman" <email@hidden>)
 >Re: NSUserdefaultsController warning (From: ∞ <email@hidden>)

  • Prev by Date: Re: Multiple Views, one NSScrollView
  • Next by Date: Question about mixing NSImage and CIImage.
  • Previous by thread: Re: NSUserdefaultsController warning
  • Next by thread: Re: NSUserdefaultsController warning
  • Index(es):
    • Date
    • Thread