• 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 from Different Implementation?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Outlet from Different Implementation?


  • Subject: Re: Outlet from Different Implementation?
  • From: Jeshua Lacock <email@hidden>
  • Date: Tue, 16 Sep 2008 22:30:22 -0600


On Sep 16, 2008, at 8:11 PM, Graham Cox wrote:


Does your accessor look like mine above, or does it look like this:

+ (id)	myOutlet
{
   return MyOutlet;
}


The '+' or '-' symbol in front of the method is very important. + means it's a class method, - means it's an instance method. See here:


http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_3_section_3.html#/ /apple_ref/doc/uid/TP30001163-CH12-TPXREF122

Yes, in my frustration, I tried had tried it both ways (+/-).

In the other implementation that I am attempting to get the value of MyOutlet from, I am calling your suggested MyOutlet accessor method with:

id MyOutletID = [MyContent MyOutlet];


It occurs to me that you have written it correctly as an instance method, but are trying to access it as a class method, so:

foo = [MyClass myOutlet]; would be wrong. You need to have an actual reference to an instance of the class, e.g. foo = [someObjectOfInterest myOutlet]; where someObjectOdInterest is declared as MyContent* someObjectOfInterest; and of course has been assigned, either using IB or using alloc/init in code.

Thats the ticket - I defined the other class as an outlet, connected it in IB, and it now works!


Thanks so much for your patience and help!!!


Best,

Jeshua Lacock
Founder/Programmer
3DTOPO Incorporated
<http://3DTOPO.com>
Phone: 877.240.1364

_______________________________________________

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


References: 
 >Outlet from Different Implementation? (From: Jeshua Lacock <email@hidden>)
 >Re: Outlet from Different Implementation? (From: Graham Cox <email@hidden>)
 >Re: Outlet from Different Implementation? (From: Jeshua Lacock <email@hidden>)
 >Re: Outlet from Different Implementation? (From: Graham Cox <email@hidden>)
 >Re: Outlet from Different Implementation? (From: Jeshua Lacock <email@hidden>)
 >Re: Outlet from Different Implementation? (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Bug with -changeAttributes: in NSFontManager/Font Panel?
  • Next by Date: Re: NSOutlineView: Which row is selected.
  • Previous by thread: Re: Outlet from Different Implementation?
  • Next by thread: Does NSTextField sends delegate messages to itself?
  • Index(es):
    • Date
    • Thread