• 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: [NSMutableArray array]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NSMutableArray array]


  • Subject: Re: [NSMutableArray array]
  • From: Jens Alfke <email@hidden>
  • Date: Thu, 8 Apr 2010 09:10:22 -0700


On Apr 8, 2010, at 7:35 AM, Patrick M. Rutkowski wrote:

What I was worried about is that maybe NSMutableArray (or any
sub-class in general) would need to do some special sub-class-specific
initialization, which it might not have implemented.

That's taken care of by the initializer methods (-init etc.) Every class should have a "designated initializer" method that the other initializers call first. Subclasses should override at least that designated initializer to add their own initialization code. That ensures all initializers and factory methods will set up the object correctly.


There's always the danger that the super-class will have new static
methods added without your knowledge though.

Yes, in general that can be a problem. Usually it's not an issue when the classes are part of the same project/framework, as the base collection classes are. But if you're subclassing an external class and making some significant changes in its behavior, you might run into issues. In practice, though, this usually only happens if you're trying to do sneaky things to hack framework classes to do things they weren't meant to do...


—Jens_______________________________________________

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: 
 >[NSMutableArray array] (From: "Patrick M. Rutkowski" <email@hidden>)
 >Re: [NSMutableArray array] (From: Dave DeLong <email@hidden>)
 >Re: [NSMutableArray array] (From: "Patrick M. Rutkowski" <email@hidden>)

  • Prev by Date: Re: How to force a 32-bit/64-bit universal app to start in 32-bit mode on Leopard?
  • Next by Date: Re: How to change to the smoother single-stage animation
  • Previous by thread: Re: [NSMutableArray array]
  • Next by thread: Re: [NSMutableArray array]
  • Index(es):
    • Date
    • Thread