When I was working with the Cocoa part of my project, I could do this:
[[self.aTextView textStorage] appendAttributedString:attrstg]; // textStorage is a mutable attributed string
// release attrstg and all its components
[attrstg release];
[dict release];
[paragStyle release];
[colorHSV release];
But in the iOS counterpart, using Core Foundation attributed strings, I get bad-access exceptions unless I hang onto the strings which I am appending AND their attributes dictionaries AND the style components that went into the attributes dictionaries.
I have made the necessary changes to hang onto everything in iOS and it works OK — but what’s going on? Why the difference between Cocoa and iOS here? Nothing in the class refs for either attributed-string class mentions this issue. Am I missing something that will cause problems later?