• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to get my class instance that's in IB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How to get my class instance that's in IB
      • From: Graham <email@hidden>
    • Re: How to get my class instance that's in IB
      • From: Jonathan Hess <email@hidden>
    • Re: How to get my class instance that's in IB
      • From: Ben Lachman <email@hidden>
  • Prev by Date: Associating interface state with NIB content
  • Next by Date: Re: *** -[NSCFDictionary setObject:forKey:]: mutating method sent to immutable object
  • Previous by thread: Re: Associating interface state with NIB content
  • Next by thread: Re: How to get my class instance that's in IB
  • Index(es):
    • Date
    • Thread