On Oct 30, 2013, at 4:49 AM, 周章林 <zhanglin.z...@gmail.com> 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 (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:
> https://lists.apple.com/mailman/options/cocoa-dev/cocoadev%40charlessoft.com
> 
> This email sent to cocoa...@charlessoft.com

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

This email sent to arch...@mail-archive.com

Reply via email to