• 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: TableView crash with Delegate
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TableView crash with Delegate


  • Subject: Re: TableView crash with Delegate
  • From: Jonathan Mitchell <email@hidden>
  • Date: Tue, 14 Jun 2016 12:36:27 +0100

> On 14 Jun 2016, at 12:26, Gerriet M. Denkmann <email@hidden> wrote:
>
>
> But no problem, as long one keeps in mind (as you recommended) that awakeFromNib “can get called many times”.
>
You may be experiencing this, as described in docs for view based table views:

NSTableView - (__kindofNSView <https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSView_Class/index.html#//apple_ref/doc/c_ref/NSView> *)makeViewWithIdentifier:(NSString <https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/index.html#//apple_ref/doc/c_ref/NSString> *)identifier
                                     owner:(id)owner

This method is usually called by the delegate in tableView:viewForTableColumn:row: <https://developer.apple.com/library/mac/documentation/Cocoa/Reference/NSTableViewDelegate_Protocol/index.html#//apple_ref/occ/intfm/NSTableViewDelegate/tableView:viewForTableColumn:row:>, but it can also be overridden to provide custom views for the identifier. Note that awakeFromNib <https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Protocols/NSNibAwaking_Protocol/index.html#//apple_ref/occ/instm/NSObject/awakeFromNib> is called each time this method is called, which means that awakeFromNib is also called on owner, even though the owner is already awake.

This has thrown me for loop in the past - especially when the above note was only in the headers.

J

>
> Kind regards,
>
> Gerriet.
>
>
> _______________________________________________
>
> 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

_______________________________________________

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: 
 >TableView crash with Delegate (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: TableView crash with Delegate (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: TableView crash with Delegate (From: Alastair Houghton <email@hidden>)
 >Re: TableView crash with Delegate (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: TableView crash with Delegate
  • Next by Date: Re: DNS resolution for apps vs Terminal?
  • Previous by thread: Re: TableView crash with Delegate
  • Next by thread: Using NSTabView without a NSTabViewController; with storyboards, OS X
  • Index(es):
    • Date
    • Thread