• 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: Getting bound object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting bound object


  • Subject: Re: Getting bound object
  • From: Daniel Luis dos Santos <email@hidden>
  • Date: Sun, 13 Jul 2014 23:24:00 +0100

On 13 Jul 2014, at 21:10, Kyle Sluder <email@hidden> wrote:

> On Jul 13, 2014, at 11:24 AM, Daniel Santos <email@hidden> wrote:
>>
>> Hello,
>>
>> I have a collection view in which I have subclassed the collection view item.
>> In the awake from nib method I want to get the represented object but it is returning nil
>>
>> How can I get the bound object ?
>
> You have to wait until after -awakeFromNib. Bindings aren't hooked up and propagated until the entire object graph has been awoken.
>
> One option is to override -loadView to call super and then do your magic.
>
> --Kyle Sluder

I just tried that. But [self representedObject] returns nil when called in the subclassed NSCollectionViewItem. Any idea why ?
_______________________________________________

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: Getting bound object
      • From: Ken Thomases <email@hidden>
References: 
 >Getting bound object (From: Daniel Santos <email@hidden>)
 >Re: Getting bound object (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: KVC, binding multiple properties, top level object
  • Next by Date: Re: Getting bound object
  • Previous by thread: Re: Getting bound object
  • Next by thread: Re: Getting bound object
  • Index(es):
    • Date
    • Thread