Strangeness with non-nil, non-empty NSStrings returning a zero length. Here is how I'm setting up my string.
// property is declared like so in .h
@property (strong, nonatomic) NSString *myStringValue;
// synthesized like so in .m
@synthesize myStringValue;
// most times property is set directly like so (.m)<br />
// ...
self.myStringValue = @"Some Value";
// ...
// property is (sometimes) set like so (.m)<br />
// copied from another vc
// ...
self.myStringValue = anotherObj.myStringValue;
// ...
Zero Length
When the property has been set by assigning it from another object (the latter case), and used later on at some point in the code, [self.myStringValue length]
returns 0 even though mouseover using the debugger shows the summary text correctly as "Some Value".
NSString Optimization?
This blog talks about NSString optimizations that may happen when there are multiple NSString objects floating around in memory that contain the same string. I wonder if this could have anything to do with it. Since NSString is implemented as a class-cluster, and NSString objects may be transformed into any number of related private classes (*__NSCFString, __NSCFStringConstant*) behind the scenes for optimization purposes, perhaps this is what is causing my problem, if either of these classes happen to return zero for length messages...
Thoughts?