• 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 01:53:23 -0600


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 (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: Outlet from Different Implementation?
      • From: Graham Cox <email@hidden>
References: 
 >Outlet from Different Implementation? (From: Jeshua Lacock <email@hidden>)
 >Re: Outlet from Different Implementation? (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: NSXMLParser and character entities?
  • Next by Date: structs in Mutable containers
  • Previous by thread: Re: Outlet from Different Implementation?
  • Next by thread: Re: Outlet from Different Implementation?
  • Index(es):
    • Date
    • Thread