Re: Strange crash while loading nib
Re: Strange crash while loading nib
- Subject: Re: Strange crash while loading nib
- From: Markus Spoettl <email@hidden>
- Date: Sun, 09 Sep 2012 12:25:01 +0200
On 9/9/12 8:41 AM, Graham Cox wrote:
On 09/09/2012, at 4:25 PM, Markus Spoettl <email@hidden
<mailto:email@hidden>> wrote:
4 -[NSArrayController didChangeValuesForArrangedKeys:objectKeys:indexKeys:]
5 -[NSArrayController initWithCoder:]
This suggests that initWithCoder: is setting a property in a manner such as
self.whatever = foo; Which triggers the KVO messaging. If possible, just set the
ivar directly to avoid that. Things at this stage are often in an indeterminate
state and the object graph is incomplete, leading to odd bugs. Alternatively,
make sure nothing is trying to observe the object before everything is
completely unarchived.
Thanks for the reply, unfortunately I'm not sure I follow.
The NIB contains a custom view but that (it implements -initWithCoder:) doesn't
set any of its properties that way. It basically just calls -setLayer: and
-setWantsLayer: to make it layer hosting. Nothing that gets observed by an
NSArrayController anywhere in within this view's controller (or outside),
though. Not at the time of view initialization. The view controller's
-awakeFromNib does set up a binding from from the custom view to the
NSArrayController. But at that time, the view has been full loaded, no? When the
crash happens, it doesn't appear to get that far.
As I said, likely I'm not getting what you're trying to tell me.
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
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