dynamic var foos: NSMutableSet = [Foo(x: 0), Foo(x: 1), Foo(x: 2)]

(lldb) e/x foos as! Set<Foo>
Comparing 2 to 0
Comparing 1 to 0
(Set<SetCompare.Foo>) $R0 = ([0] = <Execution was interrupted, reason: 
Attempted to dereference an invalid ObjC Object or send it an unrecognized 
selector.
The process has been returned to the state before expression evaluation.>, [1] 
= <Execution was interrupted, reason: Attempted to dereference an invalid ObjC 
Object or send it an unrecognized selector.
The process has been returned to the state before expression evaluation.>, [2] 
= <Execution was interrupted, reason: Attempted to dereference an invalid ObjC 
Object or send it an unrecognized selector.
The process has been returned to the state before expression evaluation.>)


On 08 Jan 2016, at 19:00, Etan Kissling 
<kissl...@oberon.ch<mailto:kissl...@oberon.ch>> wrote:

In fact, it makes things even worse, and freezes up Xcode when expanding the 
set in the debugger.


On 08 Jan 2016, at 18:59, Etan Kissling 
<kissl...@oberon.ch<mailto:kissl...@oberon.ch>> wrote:

As the comments in the sample project describe in the introductory comments,
modifying the code to force an NSSet does not solve the problem.



On 08 Jan 2016, at 18:39, Quincey Morris 
<quinceymor...@rivergatesoftware.com<mailto:quinceymor...@rivergatesoftware.com>>
 wrote:

On Jan 8, 2016, at 07:14 , Etan Kissling 
<kissl...@oberon.ch<mailto:kissl...@oberon.ch>> 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 (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