• 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: Modifying Set via NSArrayController breaks Set in weird way
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Modifying Set via NSArrayController breaks Set in weird way


  • Subject: Re: Modifying Set via NSArrayController breaks Set in weird way
  • From: Quincey Morris <email@hidden>
  • Date: Fri, 08 Jan 2016 09:39:46 -0800
  • Feedback-id: 167118m:167118agrif8a:167118sAWgWymCZt:SMTPCORP

On Jan 8, 2016, at 07:14 , Etan Kissling <email@hidden> wrote:
>
> In my ViewController, there is a NSSet-based collection of such objects.
>
> final class ViewController: NSViewController {
>    dynamic var foos: Set<Foo> = [Foo(x: 0), Foo(x: 1), Foo(x: 2)]
> }

I don’t think it’s true that ‘foos’ is a NSSet. Rather, it’s a Swift Set that can be bridged to/from a NSSet, and it’s not clear (from any documentation I’ve read) that automatic bridging is going to occur when it’s accessed from a NSArrayController.

It may be necessary to declare ‘foos’ as a NSSet explicitly in this case.

_______________________________________________

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


References: 
 >Modifying Set via NSArrayController breaks Set in weird way (From: Etan Kissling <email@hidden>)

  • Prev by Date: Modifying Set via NSArrayController breaks Set in weird way
  • Next by Date: Re: Modifying Set via NSArrayController breaks Set in weird way
  • Previous by thread: Modifying Set via NSArrayController breaks Set in weird way
  • Next by thread: Re: Modifying Set via NSArrayController breaks Set in weird way
  • Index(es):
    • Date
    • Thread