On May 2, 2008, at 19:05, Markus Spoettl wrote:

Following the "View Programming Guide for Cocoa" if I use a Custom- View proxy in IB, the view's initWithFrame: method will be called when the NIB is loaded (this can be found in "Initializing View Instances Created in Interface Builder").

I do have a custom NSView derived view and a simple window with one proxy custom view in it. The class name is set to my view's class, but the initializer does not get called. awakeFromNib: is called, though.

Is this a documentation error or is there something I have to do before the dedicated initializer is getting called by the framework? My view has a couple of objects it has to allocate, the initializer being the best place.

I don't know why initWithFrame: isn't being called in your case, but someone from Apple did say on this list a few weeks ago that an initializer *is* always called. If it's not initWithFrame:, it will be initWithCoder:.

Presumably that is getting called, and you could put the object allocations in there.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to