> On Jan 19, 2016, at 7:44 AM, Aandi Inston <aa...@quite.com> wrote:
> 
> I have this handy routine:
> 
> int MacNSOpenFileWithDefaultApp ( char *path )
> {
>    NSString *nsstring = [NSString stringWithUTF8String: path] ;
>    BOOL ok = [[NSWorkspace sharedWorkspace] openFile:nsstring] ;
> return ok ;
> }
> 
> Suppose we pass a folder name. The intention is to open the folder in the
> Finder.
> 
> When the app is compiled as 32-bit and run on Mac OS 10.10.5, it opens the
> folder
> and returns 1.
> 
> But when the app is compiled as 64-bit and run on the same system, it still
> opens the folder but returns 0.
> 
> Any ideas? Thanks in advance.
> _______________________________________________
> 
> 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/jake.petroules%40petroules.com
> 
> This email sent to jake.petrou...@petroules.com


Note that BOOL is a typedef for signed char in the legacy (32-bit OS X) 
runtime, and a typedef for bool in the modern (64-bit OS X, iOS, tvOS, watchOS) 
runtime. You should use `return !!ok` or `return ok != NO` to force boolean 
coercion.
-- 
Jake Petroules - jake.petroules at petroules.com

_______________________________________________

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