• 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: "Gerriet M. Denkmann" <email@hidden>
  • Date: Tue, 14 Jun 2016 11:33:02 +0700

> On 13 Jun 2016, at 21:43, Alastair Houghton <email@hidden> wrote:
>
> On 12 Jun 2016, at 10:10, Gerriet M. Denkmann <email@hidden> wrote:
>>
>> OS X 10.11.5, Xcode Version 7.3.1 (7D1014).
>>
>> App with TableView (View based). Works fine.
>> But when I give the TableView a delegate (even without implementing any NSTableViewDelegate methods) it crashes (see below).
>>
>> How to debug this?
>> Tried a symbolic breakpoint in  -[__NSArrayM objectAtIndex:] - but it crashes before reaching breakpoint.
>
> Set it to break on exceptions (or put a breakpoint on objc_exception_throw), then go back up the call stack?

This ultimately let me to the root of the problem:

My app has only one TableView, which is bound to Array Controller.
Array Controller binds its Content Array to AppDelegate with Model Key Path self.someUniqueObject.aMutableArray.
When the app starts a unique someUniqueObject gets created.

But I had:
- (void)awakeFromNib
{
	self.someUniqueObject = [ [ UniqueObject alloc ] init ];
}

The problem: awakeFromNib gets called twice: once before applicationDidFinishLaunching:, once after.
This obviously created a total mess.

Solution: move the creation of someUniqueObject to applicationDidFinishLaunching:


Thanks for your help!

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


  • Follow-Ups:
    • Re: TableView crash with Delegate
      • From: Alastair Houghton <email@hidden>
References: 
 >TableView crash with Delegate (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Re: KERN_INVALID_ADDRESS
  • Next by Date: Re: KERN_INVALID_ADDRESS
  • Previous by thread: Re: TableView crash with Delegate
  • Next by thread: Re: TableView crash with Delegate
  • Index(es):
    • Date
    • Thread