How to get my class instance that's in IB
How to get my class instance that's in IB
- Subject: How to get my class instance that's in IB
- From: Russ McBride <email@hidden>
- Date: Wed, 20 Feb 2008 18:23:34 -0800
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