Re: Documents not opening from Finder
Re: Documents not opening from Finder
- Subject: Re: Documents not opening from Finder
- From: Steve Mills <email@hidden>
- Date: Fri, 01 Mar 2013 15:59:18 -0600
On Feb 28, 2013, at 02:35:18, Uli Kusterer <email@hidden> wrote:
> Opening internally sends Apple Events. Have you checked whether the"open document" Apple event is sent and whether it looks any different? My guess is they won't use that for the open panel, but maybe they do and something's broken there?
I have tons of experience with AppleEvents under Carbon, but none under Cocoa. Where does that event come in?
I've added an NSDocumentController subclass to see if any of its document opening methods are being invoked. If I print a document from Finder, these 2 methods are called:
-(id) openDocumentWithContentsOfURL:(NSURL*)absoluteURL display:(BOOL)displayDocument error:(NSError**)outError
-(id) makeDocumentWithContentsOfURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSError **)outError
If I close the document and then open a document via my app's Open Recent submenu, nothing happens and none of them get hit. If I go through the Open menu item, these get hit:
-(IBAction) openDocument:(id)sender
-(NSInteger) runModalOpenPanel:(NSOpenPanel *)openPanel forTypes:(NSArray *)types
-->returns 1
But nothing else happens. To rule out our internal print code, I can open documents via our Open or Open Recent menu items, Print, and Close any number of times and things keep working correctly. It's only when we're commanded to open and print from Finder that things get messed up. Maybe because we don't close the document when we're done, but let the user do it manually?
--
Steve Mills
office: 952-818-3871
home: 952-401-6255
cell: 612-803-6157
_______________________________________________
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