• 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: Over-release *inside* framework when setting NSTextView attributes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Over-release *inside* framework when setting NSTextView attributes


  • Subject: Re: Over-release *inside* framework when setting NSTextView attributes
  • From: Robert Clair <email@hidden>
  • Date: Tue, 14 Jun 2005 13:50:43 -0400



Douglas -

I will certainly check this out, but I'm puzzled. If I put in my own [NSDictionary isEqualToDictionary:] and put a break there, it reports its argument to of type NSZombie_NSAttributeDictionary. I have no direct control over NSAttributeDictionary it is an internal AppKit class - how is it turning into a zombie on me ?

On further probing this only happens with the shadow attribute - it happens when I enter a character with a shadow, select it and then go and change the shadow. It doesn't happen going through the same branch of code with color or font, etc.

for j o a r

It is a single threaded application. This is the routine. It is called from a routine that watches for notifications of changes in an object that mediates graphics state between the UI and the tools.

- (void) changeAttributes:(NSDictionary*) newAttributes
withActionName: (NSString*) actionName
{
NSMutableDictionary* newTypingAttributes =
[NSMutableDictionary dictionaryWithDictionary: [self typingAttributes]];


  // NSTextView doesn't have "addTypingAttributes"

  [newTypingAttributes addEntriesFromDictionary: newAttributes];

  BOOL removeShadow =
     [[newTypingAttributes objectForKey: NSShadowAttributeName]
         isEqual: [NSNull null]];


if ( removeShadow ) { [newTypingAttributes removeObjectForKey: NSShadowAttributeName]; } [super setTypingAttributes: newTypingAttributes];

  NSRange selectedRange = [self selectedRange];

  if ( selectedRange.length <= 0 ) return;

  [[self textStorage] beginEditing];

 //THIS IS THE LINE THAT CRASHES IT
  [[self textStorage] addAttributes: newAttributes
                                range: selectedRange];

  if (removeShadow )
    {
      [[self textStorage] removeAttribute: NSShadowAttributeName
                          range: selectedRange];
    }
  [[self textStorage] endEditing];

  [self postCoalescedAttributeChangeNotificationWithName: actionName];
}

.....Bob Clair


_______________________________________________ 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
  • Follow-Ups:
    • Re: Over-release *inside* framework when setting NSTextView attributes
      • From: j o a r <email@hidden>
References: 
 >Over-release *inside* framework when setting NSTextView attributes (From: Robert Clair <email@hidden>)
 >Re: Over-release *inside* framework when setting NSTextView attributes (From: Douglas Davidson <email@hidden>)

  • Prev by Date: Re: NSSliderCell does not use drawBarInside:flipped:?
  • Next by Date: Re: Getting a reference to an NSMenuItem from another nib?
  • Previous by thread: Re: Over-release *inside* framework when setting NSTextView attributes
  • Next by thread: Re: Over-release *inside* framework when setting NSTextView attributes
  • Index(es):
    • Date
    • Thread