I have a strange problem with an NSAttributedString object where I get the runtime errors below:
Code:
*** Assertion failure in -[NSRLEArray objectAtIndex:effectiveRange:], String.subproj/NSAttributedString.m:1002
Access invalid attribute location 0 (length 0)
I guess that means that some attribute applies to some text range that is not there.
The error occurs with the code:
Code:
- (NSAttributedString *)blah
{
return blah;
}
Most of the time it works fine. It only produces the error if the string has no text, but does have some attribute applied to it, but ONLY after it has been archived (to file) and unarchived again (from file).
Can anyone shed any light on why this happens only after archiving and unarchiving, or give me any more information on what the error actually means?
(where "blah" is the NSAttributed string in question)