Re: Can an NSArray ever have a count of -1?
Re: Can an NSArray ever have a count of -1?
- Subject: Re: Can an NSArray ever have a count of -1?
- From: Quincey Morris <email@hidden>
- Date: Fri, 19 Feb 2016 22:28:10 -0800
- Feedback-id: 167118m:167118agrif8a:167118sW6yQNrh1x:SMTPCORP
On Feb 19, 2016, at 22:14 , Gerriet M. Denkmann <email@hidden> wrote:
>
> Is there (yet) a Swift version of ‘[NSString stringWithFormat: “lx”, (someCast) someValue]’ ?
No, and yes, and no, and yes.
There is currently AFAIK no such native formatting syntax in Swift print statements, so “no”.
But you can of course use ‘String (format: “lx”, someCast (someValue))’. This isn’t actually cheating, because Swift has its own implementation of the entire NSString API. There’s no bridging to NSString objects involved in these functions, so “yes”.
But you can’t *use* this API in Swift unless you import Foundation. Without the import, Swift will pretend it doesn’t have those String APIs, though it really does, so “no”.
But starting with Swift 3, later this year, Foundation will migrate natively into Swift — for all supported Swift platforms, such as Linux — so I assume there will be some kind of native String formatting syntax, so “yes”, though whether it will use the same format strings as Cocoa, I don’t know.
_______________________________________________
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