I am working on implementing printing, and have it working to the point where the preview in the print sheet works. However, I get a crash if I then go on to print or go to PDF (Open in Preview, Save as PDF). In the print case, I get this crash:

2012-12-06 18:40:01.757 MyApp[43204:403] -[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x7fbe9f1d9830
2012-12-06 18:40:01.762 MyApp[43204:403] (
0 CoreFoundation 0x00007fff8c0abf56 __exceptionPreprocess + 198 1 libobjc.A.dylib 0x00007fff836aad5e objc_exception_throw + 43 2 CoreFoundation 0x00007fff8c1381be -[NSObject doesNotRecognizeSelector:] + 190 3 CoreFoundation 0x00007fff8c098e23 ___forwarding___ + 371 4 CoreFoundation 0x00007fff8c098c38 _CF_forwarding_prep_0 + 232 5 PrintCocoaUI 0x0000000110a02adf CreateDefaultFileName + 16419 6 PrintCocoaUI 0x00000001109f36d9 PrintCocoaUI + 18137 7 PrintCocoaUI 0x00000001109f3403 PrintCocoaUI + 17411 8 PrintCocoaUI 0x0000000110a0d1c1 CreateDefaultFileName + 59141 9 PrintCocoaUI 0x0000000110a0cf9a CreateDefaultFileName + 58590 10 CoreFoundation 0x00007fff8c09b70d -[NSObject performSelector:withObject:] + 61 11 AppKit 0x00007fff8c4848ca -[NSApplication sendAction:to:from:] + 139 12 AppKit 0x00007fff8c4847fe -[NSControl sendAction:to:] + 88 13 AppKit 0x00007fff8c484729 -[NSCell _sendActionFrom:] + 137 14 AppKit 0x00007fff8c483bec -[NSCell trackMouse:inRect:ofView:untilMouseUp:] + 2014 15 AppKit 0x00007fff8c503b74 -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 489 16 AppKit 0x00007fff8c4827f6 -[NSControl mouseDown:] + 786 17 AppKit 0x00007fff8c44dc98 -[NSWindow sendEvent:] + 6306 18 AppKit 0x00007fff8c3e73a5 -[NSApplication sendEvent:] + 5593 19 AppKit 0x00007fff8c37da0e -[NSApplication run] + 555 20 AppKit 0x00007fff8c5f9eac NSApplicationMain + 867
    21  MyApp                               0x000000010ed91952 main + 34
    22  MyApp                               0x000000010ed871a4 start + 52


In the Open in Preview case, I get this:

2012-12-06 18:37:51.396 MyApp[43174:403] An uncaught exception was raised
2012-12-06 18:37:51.397 MyApp[43174:403] -[__NSCFString objectForKey:]: unrecognized selector sent to instance 0x7fb6bc76c230
2012-12-06 18:37:51.402 MyApp[43174:403] (
0 CoreFoundation 0x00007fff8c0abf56 __exceptionPreprocess + 198 1 libobjc.A.dylib 0x00007fff836aad5e objc_exception_throw + 43 2 CoreFoundation 0x00007fff8c1381be -[NSObject doesNotRecognizeSelector:] + 190 3 CoreFoundation 0x00007fff8c098e23 ___forwarding___ + 371 4 CoreFoundation 0x00007fff8c098c38 _CF_forwarding_prep_0 + 232 5 PrintCocoaUI 0x000000010ef6aadf CreateDefaultFileName + 16419 6 PrintCocoaUI 0x000000010ef5b6d9 PrintCocoaUI + 18137 7 PrintCocoaUI 0x000000010ef5b403 PrintCocoaUI + 17411 8 PrintCocoaUI 0x000000010ef751f2 CreateDefaultFileName + 59190 9 PrintCocoaUI 0x000000010ef74d89 CreateDefaultFileName + 58061 10 CoreFoundation 0x00007fff8c09b70d -[NSObject performSelector:withObject:] + 61 11 AppKit 0x00007fff8c4848ca -[NSApplication sendAction:to:from:] + 139 12 AppKit 0x00007fff8c5717ff -[NSMenuItem _corePerformAction] + 399 13 AppKit 0x00007fff8c571536 -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] + 125 14 AppKit 0x00007fff8c810b08 -[NSMenu _internalPerformActionForItemAtIndex:] + 38 15 AppKit 0x00007fff8c69f6f9 -[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:] + 138 16 AppKit 0x00007fff8c4eb9bb NSSLMMenuEventHandler + 339 17 HIToolbox 0x00007fff81911234 _ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec + 1263 18 HIToolbox 0x00007fff81910840 _ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec + 446 19 HIToolbox 0x00007fff819276db SendEventToEventTarget + 76 20 HIToolbox 0x00007fff8196d7b5 _ZL18SendHICommandEventjPK9HICommandjjhPKvP20OpaqueEventTargetRefS5_PP14OpaqueEventRef + 398 21 HIToolbox 0x00007fff81a54e2d SendMenuCommandWithContextAndModifiers + 56 22 HIToolbox 0x00007fff81a9c5b5 SendMenuItemSelectedEvent + 253 23 HIToolbox 0x00007fff81966883 _ZL19FinishMenuSelectionP13SelectionDataP10MenuResultS2_ + 101 24 HIToolbox 0x00007fff81a94fed _ZL19PopUpMenuSelectCoreP8MenuData5PointdS1_tjPK4RecttjS4_S4_PK10__CFStringPP13OpaqueMenuRefPt + 1660 25 HIToolbox 0x00007fff81a952ac _HandlePopUpMenuSelection7 + 621 26 AppKit 0x00007fff8c6a23c5 _NSSLMPopUpCarbonMenu3 + 3860 27 AppKit 0x00007fff8ca500fa _NSPopUpCarbonMenu3 + 39 28 AppKit 0x00007fff8c6a052a -[NSCarbonMenuImpl popUpMenu:atLocation:width:forView:withSelectedItem:withFont:withFlags:withOptions:] + 322 29 AppKit 0x00007fff8c8811f1 -[NSPopUpButtonCell trackMouse:inRect:ofView:untilMouseUp:] + 564 30 AppKit 0x00007fff8c4827f6 -[NSControl mouseDown:] + 786 31 AppKit 0x00007fff8c44dc98 -[NSWindow sendEvent:] + 6306 32 AppKit 0x00007fff8c3e73a5 -[NSApplication sendEvent:] + 5593 33 AppKit 0x00007fff8c37da0e -[NSApplication run] + 555 34 AppKit 0x00007fff8c5f9eac NSApplicationMain + 867
    35  MyApp                               0x000000010d327952 main + 34
    36  MyApp                               0x000000010d31d1a4 start + 52

Neither is in my code, and trying things like GuardMalloc, Zombies, and the like have not helped. It seems to be trying to create a default file name, but what would it be looking for there?

Any clues as to what I might have done wrong or not done at all? Or pointers on how to tackle this sort of error?

Thanks in advance,
John
--
John Brownie, john_brow...@sil.org or j.brow...@sil.org.pg
Summer Institute of Linguistics      | Mussau-Emira language, Mussau Is.
Ukarumpa, Eastern Highlands Province | New Ireland Province
Papua New Guinea                     | Papua New Guinea
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to