• 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: Why IBOutlet don't work under NSTableCellView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why IBOutlet don't work under NSTableCellView?


  • Subject: Re: Why IBOutlet don't work under NSTableCellView?
  • From: Charles Srstka <email@hidden>
  • Date: Fri, 08 Nov 2013 10:06:54 -0600

On Oct 30, 2013, at 4:49 AM, 周章林 <email@hidden> wrote:

> Hi, all,
>
> I am trying to use NSTableView in our project, and I customized class which
> inherit NSImageView, that's MyImage. In MyImage, I declared a property
> (IBOutlet) "ref". Then I insert this customized view to NSTableCellView in
> Interface Builder, and I connect "ref" with a customized
> class-"MyReference" object . The problem is "ref" is always nil in the
> MyImage instance.
>
> I have tried to set breakpoint in the -[MyImage initWithFrame:] and
> -[MyImage setRef:], and found the former method is invoked 2 times, but the
> later only once. Can anybody explain why this happen? And I want to make
> the "ref" outlet work, what should I do?
>
> I also attached the sample project in attachment.
> <tabletest.zip>_______________________________________________
>
> 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

Views inside view-based table views can't have references, whether through outlets or bindings, with anything but the table view's delegate. If you give your object an outlet to the table's delegate, and then give the table's delegate an outlet to your "ref" object, then that will work.

Charles


_______________________________________________

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: Why IBOutlet don't work under NSTableCellView?
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: SKIndexAddDocument crashing
  • Next by Date: Re: Why IBOutlet don't work under NSTableCellView?
  • Previous by thread: Re: Why IBOutlet don't work under NSTableCellView?
  • Next by thread: Re: Why IBOutlet don't work under NSTableCellView?
  • Index(es):
    • Date
    • Thread