4

I have an strange error after removing an object in a NSMutableArray.

Before deleting an object

If i remove an object with

[Array removeObjectAtIndex:2];

the array changed to this:

enter image description here

why are there now 2 ContactViewControllers??

8
  • 1
    +1 Excellent question. Did you notice that the original SolutionViewController at index 6 has gone missing too? Commented Feb 12, 2013 at 13:54
  • 3
    can you show more of the code? Commented Feb 12, 2013 at 13:55
  • 2
    This has nothing directly to do with our question, but do yourself a favor and don't use uppercase object/variable names. In Objective-C, only classes, interfaces and the like should have uppercase names. Commented Feb 12, 2013 at 14:03
  • 1
    it is not cloning by the way. It is the same pointer. Commented Feb 12, 2013 at 14:03
  • 1
    @DavidBenAri Xcode 4.6 Commented Feb 12, 2013 at 14:18

1 Answer 1

7

lldb lies sometimes. It gets confused and will display the incorrect information. Try doing

po Array

you should see the correct array contents then.

Sign up to request clarification or add additional context in comments.

2 Comments

This is scary... I thought Apple would've fixed this bug by now
Yes it's quite stupid. lldb will often fail to showing anything up the stack, and sometimes confuses one variable with another.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.