Re: Outlet from Different Implementation?
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