On Sep 15, 2008, at 11:12 PM, Graham Cox wrote:

You need to write an accessor method to return it, as written above what you're doing isn't supported automagically. You could access it as a named property:

float foo = [[MyContent valueForKey:@"MyOutlet"] floatValue];

but when you consider what valueForKey: has to do to make this work, if performance is a consideration you'll be much better off writing an accessor. Since they are your classes, there's no reason why you couldn't or shouldn't.

Hello,

Darn, I like 'automagically' much better!

        ;)

Right now I am just adding a field so I can change values for debugging purposes, so performance is not a primary consideration.

However, I tried using the valueForKey method as suggested, and I get a message "___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___".

The "MyOutlet" outlet works as expected in the "MyContent" implementation.

Any suggestions would be appreciated, or if someone could someone point me to a good "accessor method" example or documentation, I would be grateful.


Thank you,

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

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to