• 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
Re: Outlet connecting two custom classes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Outlet connecting two custom classes


  • Subject: Re: Outlet connecting two custom classes
  • From: George Orthwein <email@hidden>
  • Date: Wed, 5 Jul 2006 01:30:46 -0400

Outlets are just instance variables pointing to other objects instantiated in the nib... NOT to the instance variables of those objects. So IBOutlet NSString *str; only makes sense if you want to connect to an instantiated NSString!

In MyDocument you want an outlet to your instantiated MyView object:
IBOutlet MyView *view;

In MyView you can declare the instance variable:
NSString *str;

And create accessor methods:
- (NSString *)str;
- (void)setStr:(NSString *)newStr;

And from MyDocument you would access it:
[view str];
[view setStr];

More info:
http://developer.apple.com/cgi-bin/search.pl? q=outlets&num=10&site=default_collection


George
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Outlet connecting two custom classes (From: Wes Peterson <email@hidden>)

  • Prev by Date: Re: Show/Hide Toolbar Menu Item in Document-based application
  • Next by Date: index out of bounds
  • Previous by thread: Outlet connecting two custom classes
  • Next by thread: NSOpenPanel not respecting file types?
  • Index(es):
    • Date
    • Thread