Re: sandbox method to open my user manual pdf
Re: sandbox method to open my user manual pdf
- Subject: Re: sandbox method to open my user manual pdf
- From: Sean McBride <email@hidden>
- Date: Tue, 18 Dec 2012 14:50:41 -0500
- Organization: Rogue Research Inc.
On Tue, 18 Dec 2012 17:53:53 +0000, Keith Knauber said:
>Another simple task made impossibly complex by the sandbox…
>opening User_Manual_v3.6.pdf
That was the case in old version of 10.7... what version are you using?
>NSString *userManual = [[NSBundle mainBundle]
>pathForResource:@"User_Manual_v3.6" ofType:@"pdf"];
>[[NSWorkspace sharedWorkspace] openFile: userManual]; // sandbox violation
I do it this way:
NSBundle* bundle = [NSBundle bundleForClass:[self class]];
NSURL* url = [bundle URLForResource:@"foo" withExtension:@"pdf"];
BOOL success = [[NSWorkspace sharedWorkspace] openURL:url];
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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