Re: why don't custom views have a "tag" in IB?
Re: why don't custom views have a "tag" in IB?
- Subject: Re: why don't custom views have a "tag" in IB?
- From: James Bucanek <email@hidden>
- Date: Tue, 21 Nov 2006 17:45:03 -0700
Matt Neuburg wrote on Tuesday, November 21, 2006:
>On or about 11/21/06 12:39 PM, thus spake "James Bucanek"
>> You need to define a custom subclass of NSView
>> (MyView.h/MyView.m), then import that class definition (MyView.h) into IB.
>> Create a custom NSView object, then set its custom class to the class of your
>> NSView subclass and ... voila! ... all of the outlets and actions in your
>> custom subclass are now available for binding in IB.
>
>Okay, I see the problem. It only works in that direction, and this requires
>that the IBOutlet hint be used. You cannot, as with other classes, edit the
>outlet list directly in IB.
Not really. The technique that I described is the one I tend to use, just to make sure the definition of my class in IB is consistent with the definition on my class in Objective-C. However, there is nothing stopping you from defining a new class in IB or randomly altering the outlets and actions in an existing class. Simply select the class in the class browser, go to the inspector palette, and edit away.
Techincally, all class definitions in IB are independent of the actual class definitions in Objective-C. The "Read Files..." and "Create Files..." command simply make syncronizing them easier. But there is no requirement that you write your class files with IBOutlet and IBAction keywords.
James Bucanek
____________________________________________________________________
Author of Beginning Xcode ISBN: 047175479X
<http://www.beginningxcode.com/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden