Re: NSUserdefaultsController warning
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