• 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: dynamic binding in initializers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dynamic binding in initializers


  • Subject: Re: dynamic binding in initializers
  • From: Dave Zarzycki <email@hidden>
  • Date: Thu, 24 Feb 2011 07:02:31 -0800

Roland,

Check this out:

	http://cocoawithlove.com/2008/03/cocoa-application-startup.html

The code should arguably live in a +initialize method.

davez



On Feb 24, 2011, at 6:41 AM, Roland King wrote:

> I burned myself today with a pattern I've been using for ages. I have lots of UIView subclasses which could be initialized with initWithFrame: or initWithCoder: so I have one -(void)internalInit method which I call from both of them to do the real work. Of course eventually I went and subclassed one of my own classes and the call to internalInit inside the init method of the superclass was routed to the subclass one (which then got called again of course when the subclass called it), result, badly initialized superclass, leaky subclass.
>
> ok in objective-C init just isn't special so I shouldn't have expected it to call the local init. Is there a way I could have forced the call to be interpreted at the superclass level, or should I change my 'internalInit' to 'internalInit<myClassNameHere>' to stop this happening? _______________________________________________
>
> 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

_______________________________________________

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: dynamic binding in initializers
      • From: Roland King <email@hidden>
References: 
 >dynamic binding in initializers (From: Roland King <email@hidden>)

  • Prev by Date: Re: "Highlight" a window of another application
  • Next by Date: Using asynchronous APIs with NSOperation
  • Previous by thread: dynamic binding in initializers
  • Next by thread: Re: dynamic binding in initializers
  • Index(es):
    • Date
    • Thread