NSNotificationQueue EXC_BAD_ACCESS problems
NSNotificationQueue EXC_BAD_ACCESS problems
- Subject: NSNotificationQueue EXC_BAD_ACCESS problems
- From: "Karan, Cem (Civ, ARL/CISD)" <email@hidden>
- Date: Tue, 7 Oct 2008 10:28:24 -0400
- Thread-topic: NSNotificationQueue EXC_BAD_ACCESS problems
I'm having a great deal of trouble getting my notification queue to work correctly. It always causes a EXC_BAD_ACCESS
whenever I post using NSPostASAP or NSPostWhenIdle, but it works when I post using NSPostNow. Here are the relevant lines of code:
-(void) testMethod
{
NSNotification *tempNotification = [NSNotification notificationWithName:@"DummyName" object:self userInfo:nil];
[[NSNotificationQueue defaultQueue] enqueueNotification:tempNotification postingStyle:NSPostNow
coalesceMask:(NSNotificationCoalescingOnName | NSNotificationCoalescingOnSender) forModes:nil];
}
If I change NSPostNow to NSPostASAP, then it immediately crashes. In the last crash, the stack looked like this:
#0 0x964e6688 in objc_msgSend
#1 0x931731da in _nsnote_callback
#2 0x90722aba in __CFXNotificationPost
#3 0x90722d93 in _CFXNotificationPostNotification
#4 0x931a071c in -[NSNotificationCenter postNotification:]
#5 0x931d3121 in postQueueNotifications
#6 0x9073f9c2 in __CFRunLoopDoObservers
#7 0x90740d1c in CFRunLoopRunSpecific
#8 0x90741cf8 in CFRunLoopRunInMode
#9 0x94902480 in RunCurrentEventLoopInMode
#10 0x949021d2 in ReceiveNextEventCommon
#11 0x9490210d in BlockUntilNextEventMatchingListInMode
#12 0x9580b3ed in _DPSNextEvent
#13 0x9580aca0 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
#14 0x95803cdb in -[NSApplication run]
#15 0x957d0f14 in NSApplicationMain
#16 0x0000a7fe in main at main.mm:13
The precise line I get the EXC_BAD_ACCESS is:
0x964e6688 <+0024> mov 0x20(íx),íi
and this seems to happen at the end of the runloop. I tried removing the coalesceMask arguments, but no luck. Note that NSPostNow causes all the code to work completely correctly, its just the other two modes that it doesn't work. Anyone have any clue what is going on?
This is on a OS X 10.5.5 machine with MacFUSE 1.7 installed. The code is being compiled using Xcode 3.1.1.
Thanks,
Cem Karan
_______________________________________________
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