> On 3 Sep 2016, at 00:23, Quincey Morris <quinceymor...@rivergatesoftware.com> 
> wrote:

[…]

> My only quibble would be the double bridging:
> 
>> let swiftString = uitv.text                          // bridging from 
>> NSString to String
>> let nsString = swiftString as NSString               // bridging from String 
>> to NSString
> 
> Technically, bridging is a value conversion, though in practice the 
> underlying concrete NSString subclass likely survives the “conversion". The 
> danger is that there’s no API contract that prevents the generated code from 
> *really* converting the underlying representation, and that might lead you 
> back into the non-uniqueness-of-representation problem. So, I’d suggest:
> 
>> let nsString = uitv.text as NSString
> 
> which keeps you in the NSString domain.

I did not know this. Thanks for telling me.
I have fixed my code accordingly.


Kind regards,

Gerriet.


_______________________________________________

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

Reply via email to