• 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: A Data Object in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A Data Object in Cocoa


  • Subject: Re: A Data Object in Cocoa
  • From: glenn andreas <email@hidden>
  • Date: Sun, 11 Jan 2009 09:08:44 -0600


On Jan 10, 2009, at 11:48 PM, Michael Ash wrote:

Except that if Apple renames one of their ivars to match the name of one of your subclass's ivars.... nothing happens. You don't crash, you don't misbehave. Everything continues on like usual.

Unlike methods, ivars are *not* looked up by name, but rather by offset.


Not true under 64 bit Objective-C 2.0 (nor the iPhone's 32 bit Objective-C 2.0) which do not use an offset.


And under those "modern" platforms, Apple doesn't even have to rename an ivar - they can freely add new ivars to the base class, which increases the chance of this collision (instead of just being limited to the rename of an existing reserved ivar).

The question, of course, is what happens when a super class in a framework adds an ivar whose name collides with an existing subclass's ivar is probably a question for Greg Parker... If the ivar "key" is based on the ivar name + class where the compiler saw the ivar was declared, everything is good. If it is just ivar name, problems.

Perhaps this discussion should be taken to the Objective-C mailing list.

Glenn Andreas email@hidden
<http://www.gandreas.com/> wicked fun!
quadrium2 | build, mutate, evolve, animate | images, textures, fractals, art



_______________________________________________

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: A Data Object in Cocoa
      • From: "Michael Ash" <email@hidden>
References: 
 >Re: A Data Object in Cocoa (From: Andy Lee <email@hidden>)
 >Re: A Data Object in Cocoa (From: "Michael Ash" <email@hidden>)

  • Prev by Date: Re: How to add a -(unsigned long long)unsignedLongLongValue method to NSString
  • Next by Date: Re: How to add a -(unsigned long long)unsignedLongLongValue method to NSString
  • Previous by thread: Re: A Data Object in Cocoa
  • Next by thread: Re: A Data Object in Cocoa
  • Index(es):
    • Date
    • Thread