PDA

View Full Version : Cocoa: NSView/Custom




MacDonaldsd
Sep 1, 2007, 03:38 PM
Is there any tutorials that show you how to load a NSView into a CustomView ? As I would like to be able to use this as it seems a cleaner way to organize things.



Nutter
Sep 1, 2007, 04:50 PM
The "Custom View" item in Interface Builder is actually just a placeholder. When the nib gets loaded your custom view is instantiated in place of the custom view placeholder in the nib.

So, all you need to do is create your NSView subclass in Xcode, and then enter its class name into the attributes of the custom view in Interface builder.

MacDonaldsd
Sep 2, 2007, 12:54 PM
The "Custom View" item in Interface Builder is actually just a placeholder. When the nib gets loaded your custom view is instantiated in place of the custom view placeholder in the nib.

So, all you need to do is create your NSView subclass in Xcode, and then enter its class name into the attributes of the custom view in Interface builder.

Thanks for that. You clear explanation made it make sense to me, I couldn't find and explanation about it on the internet.