Re: Swift bindings issue, Swift.Dictionary, NSMutableDictionary and NSObjectController
Re: Swift bindings issue, Swift.Dictionary, NSMutableDictionary and NSObjectController
- Subject: Re: Swift bindings issue, Swift.Dictionary, NSMutableDictionary and NSObjectController
- From: Jens Alfke <email@hidden>
- Date: Sun, 14 Feb 2016 10:58:11 -0800
> On Feb 14, 2016, at 2:06 AM, Samuel Williams <email@hidden> wrote:
>
> 2/ Should I prefer NSMutableDictionary in the Swift code?
It looks like you’ll need to use Foundation collection classes, for properties that you want to bind in this way.
Remember, Swift’s native arrays and dictionaries aren’t toll-free bridged to NSArray and NSDictionary, so you can’t always use them interchangeably. They’re just copied to/from Foundation objects on demand, by the compiler. But binding doesn’t happen at compile time, so at runtime you end up with the key-value-coding implementation trying to operate on a native Swift object it doesn’t understand.
—Jens
_______________________________________________
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