Note that there are some explanatory texts on larger screens.

plurals
  1. POObjective-C: Is there any way to find out what kind of object resides at a particular memory address?
    primarykey
    data
    text
    <p>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? </p> <p>I am asking because my application terminated with a cryptic message that reads: </p> <p><code>Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSDecimalNumber encodedURLParameterString]: unrecognized selector sent to instance 0x164840'</code></p> <p>and would like to get some clues as to what is going wrong.</p> <p>And if that is not possible, some debugging techniques for such error messages would be greatly appreciated.</p> <p>Thanks in advance!! </p> <p><strong>EDIT: Follow Up Concern (MOVED <a href="https://stackoverflow.com/questions/3270071/nsstring-string-somestring-vs-nsstring-string-nsstring-alloc-initwith">HERE</a>)</strong> </p> <p>After some investigation of the framework that I have been using, I came across something that I don't really understand. </p> <p>If I have a method</p> <pre><code>- (void) myMethod:(NSString *)string { [Object anothermethodWithString:string]; } </code></pre> <p>and I call </p> <pre><code>[Object myMethod:@"this is a string"]; </code></pre> <p>Do I need to do something like</p> <pre><code>NSString *string2 = [[NSString alloc] initWithFormat:@"%@", string]; [Object anothermethodWithString:string2]; [string2 release]; </code></pre> <p>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? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload