Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: building a custom NSView with IB?




On 9 Dec 2008, at 10:58 am, Bill Janssen wrote:

I've got a few outlets and actions defined in the Custom view that are
connected to the buttons and textview. Something has to run to hook
them together, after instantiating an instance of the custom view. Seems
to me the standard way of doing this is to somehow just save the custom view
to a separate nib, and reinstantiate it from that nib. Is that correct?


Doesn't sound right.

The custom view shouldn't normally need outlets to the other views, but the controller that handles them typically would do. This controller, which is likely to be a NSWindowController subclass, is "File's Owner". It might have an outlet to the custom view but it doesn't need to have.

If the nib overall doesn't represent a window (why not?) then "File's Owner" would represent some other object in your app (usually a controller of some sort) and it would still have the outlets to the various controls.

"Something has to run to hook them together". Yes, but it happens automatically when the nib is loaded - it's not something you need to worry about usually.

Something somewhere is a bit muddled, since I'm having trouble really understanding what *you* are misunderstanding... perhaps you could give a bit more context about what this is and how you are trying to use it.

--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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >building a custom NSView with IB? (From: Bill Janssen <email@hidden>)
 >Re: building a custom NSView with IB? (From: Corbin Dunn <email@hidden>)
 >Re: building a custom NSView with IB? (From: Bill Janssen <email@hidden>)



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

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.