Coming from Java and Python, I am not so well versed in memory management, but is there any way to find out what kind of object resides at a particular memory address?
I am asking because my application terminated with a cryptic message that reads:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSDecimalNumber encodedURLParameterString]: unrecognized selector sent to instance 0x164840'
and would like to get some clues as to what is going wrong.
And if that is not possible, some debugging techniques for such error messages would be greatly appreciated.
Thanks in advance!!
EDIT: Follow Up Concern (MOVED HERE)
After some investigation of the framework that I have been using, I came across something that I don't really understand.
If I have a method
- (void) myMethod:(NSString *)string {
[Object anothermethodWithString:string];
}
and I call
[Object myMethod:@"this is a string"];
Do I need to do something like
NSString *string2 = [[NSString alloc] initWithFormat:@"%@", string];
[Object anothermethodWithString:string2];
[string2 release];
instead of the way I had myMethod before? It seems like the string I passed through the parameter of my method got released somewhere, and doing that solves my problem. I guess I don't really understand what exactly @"string" does in terms of memory. Is it like an auto-released NSString?