Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: NSView subclass does not call designated initializer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView subclass does not call designated initializer



On 22/08/2011, at 10:57 PM, allan greenier wrote:

> This is for an iPhone app.I've made a subclass (named Box) of NSView,


??? iPhone has no class called NSView...

> Xcode 4.1 made it with a designated initializer for me to fill out.
> - (id)initWithFrame:(CGRect)frame
> I've dropped a view into my window in Interface Builder, set it's class to Box.
> I am *positive* that the view is my class.
> When I run the app, the designated initializer does not run.

Assuming you meant UIView, when views are dearchived from a nib, they are initialised using -initWithCoder:, not initWithFrame:



--Graham



_______________________________________________

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: 
 >NSView subclass does not call designated initializer (From: allan greenier <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.