• 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: Make Custom Struct Key-Value Coding Compliant
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make Custom Struct Key-Value Coding Compliant


  • Subject: Re: Make Custom Struct Key-Value Coding Compliant
  • From: Richard Somers <email@hidden>
  • Date: Sun, 12 Feb 2012 00:40:18 -0700

On Feb 11, 2012, at 11:56 PM, Graham Cox wrote:

> Making it an object is easy and usually it turns out that the desire to resist doing that is misguided, based on some faulty assumptions. What are yours?


Geometry objects are slow which is why Cocoa has the likes of NSPoint, NSSize, and NSRect.

If I use an object then each managed object attribute would look something like this.

     1. Persistent Attribute (NSString so it is readable in the XML store)

     2. Transient Shadow Attribute (must be an object)

     3. Struct Obtained from the Shadow Attribute

It just seems so heavy. My app will be using the scalar accessors very frequently.

Karoly Lorentey has a blog entry "Efficient Scalar Attributes in Core Data" for iOS. I was trying to follow his lead except target Mac OS X v10.6 using a struct instead of a single scalar but it has been rough going.

     http://blog.lorentey.hu/2010/10/31/core-data-scalars/


On Feb 12, 2012, at 12:18 AM, Kyle Sluder wrote:

> Also, as we transition toward ARC, we will need to switch to objects instead of structs containing pointers to objects. So it's better to just get in the habit of using objects throughout, whether it's NSDictionaries or custom NSObject subclasses.

My struct contains no pointers.


--Richard


_______________________________________________

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


  • Follow-Ups:
    • Re: Make Custom Struct Key-Value Coding Compliant
      • From: Graham Cox <email@hidden>
    • Re: Make Custom Struct Key-Value Coding Compliant
      • From: Kyle Sluder <email@hidden>
References: 
 >Make Custom Struct Key-Value Coding Compliant (From: Richard Somers <email@hidden>)
 >Re: Make Custom Struct Key-Value Coding Compliant (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Make Custom Struct Key-Value Coding Compliant
  • Next by Date: Re: Make Custom Struct Key-Value Coding Compliant
  • Previous by thread: Re: Make Custom Struct Key-Value Coding Compliant
  • Next by thread: Re: Make Custom Struct Key-Value Coding Compliant
  • Index(es):
    • Date
    • Thread