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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to