I determined that my application crashes on the following line:
if(sourceValues != nil && [sourceValues class] == [NSMutableArray class])
[sourceValues release];
“sourceValues” is declared as an NSMutableArray at the top of my class. The “if” loop is satisfied, and the [sourceValues release] call gets made, which crashes the program with no error code. So, since sourceValues != nil and since [sourceValues class] == [NSMutableArray class], I wanted to see exactly what sourceValues was. So, above the “if” loop I added the following:
NSLog(@"sourceValues is %@", sourceValues);
But my program will not print it. It just crashes with no error code on that line. So, if sourceValue exists and if it an NSMutableArray, why will it not be printed. What is the problem here?
I’m trying to have code that says “if sourceValues has been allocated, release it.” How can I do this?
Why not use:
You may want to use other methods like:
isMemberOfClass: