Re: How to get my class instance that's in IB
Re: How to get my class instance that's in IB
- Subject: Re: How to get my class instance that's in IB
- From: Ben Lachman <email@hidden>
- Date: Wed, 20 Feb 2008 21:35:20 -0500
The traditional way to get at objects that have been instantiated
through IB is to connect them to your controller object via an
outlet. You can also use bindings to do some stuff without having to
directly manipulate the objects... I don't think this is what you're
going for though.
->Ben
--
Ben Lachman
Acacia Tree Software
http://acaciatreesoftware.com
email@hidden
740.590.0009
On Feb 20, 2008, at 9:23 PM, Russ McBride wrote:
I'm embarrassed to ask this question. Seems like it should be
simple but I really don't know the answer.
When I instantiate one of my classes by (in Leopard) dragging an
object icon from the library window over to the MainMenu.nib and
selecting the name of my class from the inspector window an
instance of my class is created (right?). I know because I can now
then see the NSLog statements for init method of that class showing
up in the console.
But if there's an instance of my class then I should be able to
call a method on that instance without having to make a new
instance. But how do I get ahold of that IB-created instance of my
class so that I can call one of its methods??
I know I can do this to get ahold of my class through the bundle:
NSBundle *b = [NSBundle mainBundle];
Class myClass = [b classNamed:@"MySpecialClass];
But this doesn't give me the instance.
??
_______________________________________________
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
_______________________________________________
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