Re: NSUserdefaultsController warning
Re: NSUserdefaultsController warning
- Subject: Re: NSUserdefaultsController warning
- From: ∞ <email@hidden>
- Date: Fri, 20 Jul 2007 16:48:57 +0200
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.
- ∞_______________________________________________
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