Re: instantiateNibWithOwner: fails due to "mutated while enumerated"
Re: instantiateNibWithOwner: fails due to "mutated while enumerated"
- Subject: Re: instantiateNibWithOwner: fails due to "mutated while enumerated"
- From: Jonathan Hess <email@hidden>
- Date: Tue, 5 May 2009 22:16:16 -0700
Hey Philip -
Have you tried running with a breakpoint on objc_exception_throw?
Looking at the backtrace when you hit the exception could shed some
light on what is happening. If that doesn't work, you could try a
breakpoint on NSLog(), or even write(). After you hit the breakpoint,
a quick look at the backtrace might reveal an awakeFromNib or
initWithCoder: method that's mutating a collection while enumerating it.
Good Luck -
Jon Hess
On May 5, 2009, at 1:38 PM, Philip White wrote:
Hello,
I changed the target on my program from 10.4 to 10.5, built it
fine but now the following line of code fails:
[[self nib] instantiateNibWithOwner:self
topLevelObjects:&topLevelObjects];
where [self nib] is simply
-(NSNib*)nib
{
static NSNib *nib=nil;
if (nib == nil)
nib = [[NSNib alloc] initWithNibNamed: @"DummyName" bundle: nil];
return nib;
}
The call to initWithNibNamed: works fine and I get an NSNib instance
back but instantiateNibWithOwner: fails and logs:
"*** Collection <NSCFArray: 0x17bab0> was mutated while being
enumerated."
That array is not one that I have allocated, nor am I enumerating
anything when I call that method. Just to be sure I tried invoking
that bit of code first thing in my program and it still fails. I
also tried passing NULL instead of &topLevelObjects but it made no
difference.
Again, no problems under 10.4.
I'm running this on a Powerbook G4 running 10.5.6. and XCode 3.1.2
Thanks,
Philip
_______________________________________________
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