Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-23 Thread Sean McBride
On 6/18/09 2:52 PM, Greg Guerin said: >Chilton Webb wrote: > >> Is there a way to add a tag an IB object in such a way that it is >> not visible to the user, but in such a way that I could reference >> it from my app? > > >Maybe the -tag method: it returns a 32-bit integer.. It's settable >in IB

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-19 Thread Graham Cox
On 20/06/2009, at 5:35 AM, Chilton Webb wrote: Hi, Here's why I'm asking. Right now I have an app that has a number of possibly different 'objects' in it. And I currently have a single inspector for all of them. When a new object is selected, the appropriate view for that object is adde

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-19 Thread Andy Lee
If I understand correctly: * You want to have a single general-purpose model class (what you are calling the "object") for which different object types might have different sets of attributes. Kind of like a dictionary or an NSManagedObject. * You'd like to use xib files to serve as attribute

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-19 Thread Chilton Webb
Hi, Here's why I'm asking. Right now I have an app that has a number of possibly different 'objects' in it. And I currently have a single inspector for all of them. When a new object is selected, the appropriate view for that object is added to the inspector window. This is a basically o

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-19 Thread Erik Buck
It compiles because NO == nil == NULL == 0. I shouldn't have posted the silly example which doesn't work in most cases. how about this typed in mail: @interface NSView (MYGroupEnable) /// Enable all controls nested within the receiver - (void)enableSubviews { for(NSView *currentView in [

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-19 Thread Graham Cox
On 19/06/2009, at 5:23 PM, Graham Cox wrote: However it does seem to compile without complaint, though I'm not sure why... If this is permitted, does it work with rects, points, etc? My bad - it doesn't even compile in fact, so I guess that answers that question. --Graham ___

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-19 Thread Graham Cox
On 19/06/2009, at 3:59 AM, Erik Buck wrote: use [[myBox subviews] makeObjectPerformSelector:@selector(setEnabled:) withObject:NO]; or similar. Are you certain that works? 'NO' isn't an object, so I didn't think you could use -makeObjectsPerformSelector:withObject: in this fashion - o

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Andy Lee
On Jun 18, 2009, at 4:45 PM, Michael Ash wrote: On Thu, Jun 18, 2009 at 1:59 PM, Erik Buck wrote: [...] You can populate the array entirely within IB. Make any target/ action connections in IB. http://www.geocities.com/kritter_cocoadev/ Since the last update on that page is from the Panthe

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Ricky Sharp
On Jun 18, 2009, at 5:15 PM, Chilton Webb wrote: Hi Greg! Thanks for writing back. On Jun 18, 2009, at 4:52 PM, Greg Guerin wrote: Is there a way to add a tag an IB object in such a way that it is not visible to the user, but in such a way that I could reference it from my app? Maybe the

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Greg Guerin
Chilton Webb wrote: It *would* be useful, but IB doesn't let you set it to a string in Cocoa. It's limited to numeric values, which makes it less useful for humans. For a bit of perspective, this is doable in *CARBON* apps, via the 'Command' attribute in Interface Builder. You can only us

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Chilton Webb
Hi Greg! Thanks for writing back. On Jun 18, 2009, at 4:52 PM, Greg Guerin wrote: Is there a way to add a tag an IB object in such a way that it is not visible to the user, but in such a way that I could reference it from my app? Maybe the -tag method: it returns a 32-bit integer.. It's set

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Greg Guerin
Chilton Webb wrote: Is there a way to add a tag an IB object in such a way that it is not visible to the user, but in such a way that I could reference it from my app? Maybe the -tag method: it returns a 32-bit integer.. It's settable in IB as the control's tag value. I don't know if i

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Kyle Sluder
On Thu, Jun 18, 2009 at 1:45 PM, Michael Ash wrote: > Since the last update on that page is from the Panther era, and since > Leopard's IB3 completely broke backwards compatibility with IB2 > plugins, I'd say the chances of the Foundation Collections Palette > still working are approximately zero.

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Michael Ash
On Thu, Jun 18, 2009 at 1:59 PM, Erik Buck wrote: > You can also instantiate an array and add objects to the array within IB.  > Then you only need an outlet instance variable to reference the array and not > separate instance variables for all of the user interface objects.  See > "Foundation C

Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Erik Buck
See the - (void)setRepresentedObject:(id)anObject method of NSCell.  You can set a string or dictionary and the represented object and retrieve it via -representedObject.   You can also instantiate an array and add objects to the array within IB.  Then you only need an outlet instance variable t

What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Chilton Webb
Hi, In an effort to create a less structured set of IB objects, I would like to 'tag' various IB elements. For example, I might want to add a specific tag to a group of objects that I might later want to show or hide. I might want to grab values from only objects that contain some key wor