> On 11 Mar 2015, at 17:53, Bill Cheeseman <wjcheese...@gmail.com> wrote: > > >> On Mar 11, 2015, at 4:13 AM, Bill Cheeseman <wjcheese...@gmail.com> 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. > > --
and as I pointed out in my mail - when you switch to 6.3 you will have to put the '!' back in again and have 'as! [NSRunningApplication]', which is why I said it was more consistent, because the total number of '!' stays the same. _______________________________________________ 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