On 1 Nov 2012, at 9:55 AM, Keary Suska <cocoa-...@esoteritech.com> wrote:

> This is normal and expected, as it is a default warning (at least on OS X). 
> What is the problem, exactly? There is no value whatsoever that I know of to 
> declare primitive accessors if you don't intend to implement them. 
> Furthermore, you shouldn't need to declare primitive accessors at all as they 
> should not be publicly called. Or in other terms, exposing them is probably a 
> code smell. In any case, Core Data synthesizes them for you anyway….

I haven't needed to call primitive accessors in a while, but the fact that Core 
Data synthesizes them at run time doesn't mean the compiler knows that the 
methods exist. Last I looked, you had to declare a category containing the 
primitives the class's own code (not the general public's) needed to call, or 
the compiler would complain as the OP said.

Takeaway:

Declare the primitive accessors so the compiler won't complain about their use.

Declare them in a category so the compiler won't complain that the main 
implementation doesn't contain their definitions.

It would be neat if clang inferred the existence of primitives from the 
presence of dynamic properties in an NSManagedObject subclass, so declaration 
wouldn't be necessary, but I haven't tried it.

        — F

-- 
Fritz Anderson -- Xcode 4 Unleashed: 4.5 supplement in the works -- 
<http://x4u.manoverboard.org/>


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to