NSAttributedString always returns NO for -isEqualToAttributedString with attachments present?
NSAttributedString always returns NO for -isEqualToAttributedString with attachments present?
- Subject: NSAttributedString always returns NO for -isEqualToAttributedString with attachments present?
- From: Jim Correia <email@hidden>
- Date: Wed, 7 Oct 2009 09:12:05 -0400
The documentation for -[NSAttributedString isEqualToAttributedString:]
says:
Attributed strings must match in both characters and attributes to be
equal.
It doesn't mention attachments at all.
Consider the following code:
attributedString is the input string, and it may contain image
attachments
NSData *d = [NSKeyedArchiver archivedDataWithRootObject:
attributedString];
NSAttributedString *s1 = [NSKeyedUnarchiver unarchiveObjectWithData:
d];
NSAttributedString *s2 = [NSKeyedUnarchiver unarchiveObjectWithData:
d];
NSLog(@"isEqual = %d", [s1 isEqualToAttributedString: s2]);
When 'attriburedString' does not contain image attachments, 1 is logged.
When 'attributedString' does contains image attachments, 0 is logged.
Is this the expected behavior? The correct behavior?
- Jim
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden