• 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: NSRunningApplication executableURL issue in Swift
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSRunningApplication executableURL issue in Swift


  • Subject: Re: NSRunningApplication executableURL issue in Swift
  • From: Bill Cheeseman <email@hidden>
  • Date: Wed, 11 Mar 2015 05:53:09 -0400

> On Mar 11, 2015, at 4:13 AM, Bill Cheeseman <email@hidden> wrote:
>
> Thanks guys, that was very enlightening and helpful.


I found a cleaner solution, which depends on telling the runtime that it is to use the NSRunningApplication version of the executableURL property. Then it only requires a single exclamation point.

for thisApp.NSWorkspace.sharedWorkspace().runningApplications as [NSRunningApplication]
     let thisPath = thisApp.bundleURL != nil ? thisApp.bundleUrl!.path : thisApp.executableURL!.path
     ....
}

Adding 'as [NSRunningApplication]' did the trick. This is equivalent to the workaround I mentioned in my original post, where I created a local variable specifically typed as NSRunningApplication.

--

Bill Cheeseman - email@hidden

_______________________________________________

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: NSRunningApplication executableURL issue in Swift
      • From: Roland King <email@hidden>
References: 
 >NSRunningApplication executableURL issue in Swift (From: Bill Cheeseman <email@hidden>)
 >Re: NSRunningApplication executableURL issue in Swift (From: Roland King <email@hidden>)
 >Re: NSRunningApplication executableURL issue in Swift (From: Bavarious <email@hidden>)
 >Re: NSRunningApplication executableURL issue in Swift (From: Quincey Morris <email@hidden>)
 >Re: NSRunningApplication executableURL issue in Swift (From: email@hidden)
 >Re: NSRunningApplication executableURL issue in Swift (From: Quincey Morris <email@hidden>)
 >Re: NSRunningApplication executableURL issue in Swift (From: Charles Srstka <email@hidden>)
 >Re: NSRunningApplication executableURL issue in Swift (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: NSRunningApplication executableURL issue in Swift
  • Next by Date: Re: Programmatically putting attributed string RTF on the pasteboard
  • Previous by thread: Re: NSRunningApplication executableURL issue in Swift
  • Next by thread: Re: NSRunningApplication executableURL issue in Swift
  • Index(es):
    • Date
    • Thread