• 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: noob question regarding proxy object returned by -selection method of NSArrayController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: noob question regarding proxy object returned by -selection method of NSArrayController


  • Subject: Re: noob question regarding proxy object returned by -selection method of NSArrayController
  • From: Keary Suska <email@hidden>
  • Date: Sat, 28 Jun 2008 11:53:16 -0600
  • Thread-topic: noob question regarding proxy object returned by -selection method of NSArrayController

6/28/08 11:43 AM, also sprach email@hidden:

> If I do this (have the update logic in the Person class),  then I
> can't use the proxy object returned by the -selection method of the
> NSController (because the proxy object doesn't respond to the methods
> of the backing class).
>
> My question is: What is the best way to get the actual model entry,
> so such instance methods can be invoked?

I call [[arrayController selectedObjects] objectAtIndex:0] to get the actual
object.

> BTW: I have one solution, which is to send the controller a -
> selectionIndex message, and use the resulting index to directly
> access the backing store. But doing this is based on knowing what
> that backing content object is, which seems like I am using side
> knowledge in my appController, and so I wonder if there is a way to
> get the actual model content object directly from the
> NSArrayController....

Probably a bad idea. You can't guarantee the order unless, as you say, your
controller knows too much about the view. You could use the index but use it
on -arrangedObjects, however.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

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: 
 >noob question regarding proxy object returned by -selection method of NSArrayController (From: Stuart Malin <email@hidden>)

  • Prev by Date: noob question regarding proxy object returned by -selection method of NSArrayController
  • Next by Date: Re: switching content views
  • Previous by thread: noob question regarding proxy object returned by -selection method of NSArrayController
  • Next by thread: Re: noob question regarding proxy object returned by -selection method of NSArrayController
  • Index(es):
    • Date
    • Thread