• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:


  • Subject: Re:
  • From: Jake Petroules <email@hidden>
  • Date: Tue, 19 Jan 2016 09:15:22 -0800

> On Jan 19, 2016, at 7:44 AM, Aandi Inston <email@hidden> 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 (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


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 (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


  • Follow-Ups:
    • Re:
      • From: Aandi Inston <email@hidden>
References: 
 >[no subject] (From: Aandi Inston <email@hidden>)

  • Prev by Date: [no subject]
  • Next by Date: Re:
  • Previous by thread: [no subject]
  • Next by thread: Re:
  • Index(es):
    • Date
    • Thread