• 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
Re: NSConcreteNotifyingMutableAttributedString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSConcreteNotifyingMutableAttributedString


  • Subject: Re: NSConcreteNotifyingMutableAttributedString
  • From: Ali Ozer <email@hidden>
  • Date: Thu, 31 Mar 2005 08:50:00 -0800

The code snippet you provided below looks reasonable, I don't see anything obviously wrong with it...

This message is indeed coming from an exception, so putting a breakpoint in the debugger on -[NSException raise] as Uli indicated should get you a backtrace of where the problem is occurring.

If you'd like to see what the string is at that point, you can go up to the stack frame containing addAttribute:value:range:, and do

po $r3

($r3 contains self) 

This might indicate whether there's anything corrupt with the text itself.  To see what the attribute being set is, try

po $r5

($r5 contains the first argument)

Don't know if this will help.
Ali



Begin forwarded message:

From: Pierre Chatel <email@hidden>

Date: March 30, 2005 8:39:46 PST

To: Cocoa Developer <email@hidden>

Subject: NSConcreteNotifyingMutableAttributedString



Hi there !


i have this NSTextField in my application, i enabled it for RTF and image support. So now i can drag images in the middle of the text i'm writing. I also added a standard font panel to my application.

Here comes the problem: if i select a piece of text with pictures and try to change font attributes with the font panel, i get this error and the NSTextView begins to behave strangely:


NSConcreteNotifyingMutableAttributedString addAttribute:value:range:: nil value


So i suppose that's it's somehow related to trying to apply font attributes to a pictures, and that "value" or "range" must be nil, causing the error. I looked at the code of TextEdit and i didn't find anything related to this issue: when you are in RTF mode in TextEdit you can apply font settings to text and images at the same time without problems.


Here is an extract of the code i'm using to create an empty NSTextView:


textView = [[[NSTextView alloc] initWithFrame:rectSave] autorelease];

[textView setAutoresizingMask:oldMask];

[textView setRichText:YES];

[textView setImportsGraphics:YES];

         

NSDictionary *textAttributes = [self defaultTextAttributes];

[textView setTypingAttributes:textAttributes];

        

[[[textView textStorage] mutableString] setString:@""];


Please help, as i'm really confused with this issue.

Thanks !

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSConcreteNotifyingMutableAttributedString (From: Pierre Chatel <email@hidden>)

  • Prev by Date: Re: NSConcreteNotifyingMutableAttributedString
  • Next by Date: Re: Uniquely identify a computer
  • Previous by thread: Re: NSConcreteNotifyingMutableAttributedString
  • Next by thread: Accessing NSArray objects with a key path
  • Index(es):
    • Date
    • Thread