• 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: Trouble retrieving selection from NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble retrieving selection from NSArrayController


  • Subject: Re: Trouble retrieving selection from NSArrayController
  • From: Quincey Morris <email@hidden>
  • Date: Tue, 22 Feb 2011 15:31:19 -0800

On Feb 22, 2011, at 15:04, Ayers, Joseph wrote:

> I understood from Scott Stevensons book that in 32bit mode you had to declare the instance variables.

Nope, not for Core Data (not unless you need instance variables *of your own* to implement custom properties or for some other reason). Core Data doesn't use instance variables internally at all (for your properties, I mean). See:

	http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CoreData/Articles/cdAccessorMethods.html#//apple_ref/doc/uid/TP40002154-SW9

IMO, this documentation is slightly confusing. You can *EITHER* declare the properties for Core Data-supplied scalar accessor methods (TapeName, TapeDate, Notes, VideoClip) in a class extension -- Tapes () -- and use @dynamic for each one in your implementation *OR* declare them in a non-existent category -- Tapes (TapesAccessors), if you follow the documentation's pattern -- and avoid the need for @dynamic.

The documentation doesn't make it clear that there are 2 ways of doing it.

In the case of the add/remove accessors, you can't use @dynamic to tell the compiler about the Core Data-supplied methods, so you have to use the non-existent category technique.

With your current class definition, the instance variables will be ignored completely. They will be nil unless you put something in them manually, and if you do that they have no effect on the Core Data properties.


_______________________________________________

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: 
 >Trouble retrieving selection from NSArrayController (From: "Ayers, Joseph" <email@hidden>)
 >Re: Trouble retrieving selection from NSArrayController (From: Quincey Morris <email@hidden>)
 >Re: Trouble retrieving selection from NSArrayController (From: "Ayers, Joseph" <email@hidden>)

  • Prev by Date: Re: iOS: Calling up numeric keypad
  • Next by Date: NSTextView truncating right side when printed...
  • Previous by thread: Re: Trouble retrieving selection from NSArrayController
  • Next by thread: NSTextView truncating right side when printed...
  • Index(es):
    • Date
    • Thread