• 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: Quincey Morris <email@hidden>
  • Date: Wed, 11 Mar 2015 05:44:51 +0000

On Mar 10, 2015, at 22:26 , Bavarious <email@hidden> wrote:
>
> Much like in Objective-C. If you write
>
> void someFunction(id obj) {
>    NSLog(@"%@", [obj bundleURL]);
> }
>
> the compiler picks *some* method that matches that selector

So how come this behavior has been imported into Swift? What problems does having it there actually solve? Other languages are going to laugh at us and take our lunch money if we have types like ‘NSURL!?’.

> —which method is undefined. This can be problematic when multiple methods have the same selector but different types; in particular, when one method has a floating-point type in its signature and another method doesn’t.

That’s what I don’t understand for Swift. None of the reasons I can imagine for *not* removing this behavior from Obj-C** seem applicable to Swift.


** such as:

#1: Historical precedent (Swift is all-new source code)
#2: Ugly cast syntax to clarify which selector is intended (Swift has ‘as!’)
#3: Obscures full-on polymorphism (rarely used in many classes of apps, more common usage of limited polymorphism is better expressed via protocols, which are more capable in Swift)



_______________________________________________

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: 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>)

  • Prev by Date: Different notification icons in push notifications
  • Next by Date: Re: NSRunningApplication executableURL issue in Swift
  • Previous by thread: Re: NSRunningApplication executableURL issue in Swift
  • Next by thread: Re: NSRunningApplication executableURL issue in Swift
  • Index(es):
    • Date
    • Thread