• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSAttributedString always returns NO for -isEqualToAttributedString with attachments present?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSAttributedString always returns NO for -isEqualToAttributedString with attachments present?
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Remove NSToolbar close button
  • Next by Date: Re: NSLayoutManager and best override point for temporary attributes
  • Previous by thread: Remove NSToolbar close button
  • Next by thread: Re: NSAttributedString always returns NO for -isEqualToAttributedString with attachments present?
  • Index(es):
    • Date
    • Thread