NSPointerArray weird compaction
问题 I have a weak NSPointerArray with some NSObject that has been released. Before calling compact what I see is: (lldb) po [currentArray count] 1 (lldb) po [currentArray pointerAtIndex:0] <nil> (lldb) po [currentArray allObjects] <__NSArrayM 0x16f04f00>( ) That makes sense, but what is really weird is that when I call compact on that array I see the same values! Count still returns 1 and pointerAtIndex:0 is nil . Why the nil hasn't been removed? EDIT Here's the full code (yeah it's XCTesting