I am using XCode 4.3.1 and something strange is happening when I debug my app in last few days.
Here is the code:
-(void) init
{
list = [[NSMutableArray alloc]init]; // list is declared in the header
}
-(void) dosomething
{
[self init];
// strangely the debugger shows "list" is still null here
[list addObject: something];
// but it happily steps over the above line without adding anything to the list
}
Another problem (somewhere else in the code) is that sometimes the debugger decides to jump several lines (as if it switches over to another thread but there's only one thread)
The worst part is sometimes when I step over the code it even goes backward a few lines and and then forward again.
I tried to switch to GDB but to no avail. Has anyone run into these problems?
Btw, i was doing some profiling to find memory leaks before these things start happening