Id like to understand this...im declaring a property to my Place class
like so:
NSString *placeRating;
Then i read the value from a sqlite db like so:
placeObj.placeRating = [NSString
stringWithFormat:@"%i",sqlite3_column_int(selectstmt, 0)];
this logs fine as explained before. The column type is Numeric. So
as I udnerstand, cocoa takes the numeric value and makes it into a
String value via stringWithFormat and stores it in an appropriate
NSString *placeRating. I have another ivar called placeDescription
which is the same, an NSString but uses this to read from the
database:
placeObj.placeDescription = [NSString stringWithUTF8String:(char *)
sqlite3_column_text(selectstmt, 2)];
But when i log %@ the NSString *placeDescription i get my text,
however when i log %@ my placeRating value i get garbage and more
recently, this:
kCGColorSpaceModelMonochrome 0 0....
So im trying to udnerstand....if ive stored NSString *placeRating in
the placeObj.placeRating as a stringWithFormat, it should be an
NSString object right? So why isnt it logging like its other ivar
counterparts, namely NSString *placeDescription?
I FIGURED IT OUT.....I was assigning it, not copying it or retaining
it....memory management...i thought it might be since i was getting
different garbage everytime i logged it. Could this be a rule of
thumb? If i log a variable and get different garbage each time, its
because its value has been lost and its just grabbing any value from
memory?