NSMutableArray removeObjectAtIndex strange issue.

前端 未结 2 981
挽巷
挽巷 2020-12-20 20:49

Strange behaviour in NSMutableArray.

I\'ve created object and filled it.

NSMutableArray *array = [[NSMutableArray alloc] 
                       


        
相关标签:
2条回答
  • 2020-12-20 21:15

    your same code is working fine., just clean and build the project. here is my code

    NSMutableArray *sampleArray = [[NSMutableArray alloc]
                             initWithObjects:@"1",@"2",@"3",@"4", nil];
    NSLog(@"%@", sampleArray);
    [sampleArray removeObjectAtIndex:0];
    NSLog(@"%@", sampleArray);
    
    0 讨论(0)
  • 2020-12-20 21:26

    Are you using lldb for debugging? Try gdb if so.

    lldb has known bugs of this nature where it reports the incorrect values of variables during a debug session.

    To change the debugger to gdb:

    1. Click your target in the toolbar
    2. Select 'edit schemes'
    3. Make sure the 'run' scheme is selected in the pane on the left.
    4. Change the 'Debugger' dropdown from lldb to gdb.
    0 讨论(0)
提交回复
热议问题