• 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: MyShadow was deallocated while key value observers...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MyShadow was deallocated while key value observers...


  • Subject: Re: MyShadow was deallocated while key value observers...
  • From: Lee Ann Rucker <email@hidden>
  • Date: Fri, 27 Jun 2014 14:36:04 -0700

Make sure you do self.textShadow = nil before self goes away, that's what gets rid of the observers on it.

On Jun 27, 2014, at 1:21 PM, Leonardo wrote:

> While the user moves the selection within an NSTextView, I show on the UI
> the values of the current textShadow: offsetX, offsetY and blur. In each
> textField on IB, I bind, e.g.
>
>   oObjsArrayController.selection.textShadow.offsetX
>
> So, in the textView's method textViewDidChangeSelection I do
>   attr = [self.textStorage attributesAtIndex:loc effectiveRange:effRange];
>   self.textShadow = [attr objectForKey:MyShadowAttributeName];
>
>
> textShadow is never retained. It's just a pointer that I set to nil or to
> the current selected shadow, as above, just to show the current selected
> shadow values. On the header, it looks
>
>   @property (nonatomic, assign) MyShadow      *textShadow;
>
> Sometimes, when I create a new shadow or I release the textView I get this
> bug:
>
>   MyShadow was deallocated while key value observers were still registered
>   with it...
>
> Why? I can't find a solution to this bug.
>
>
> Regards
> -- Leonardo
>
>
> _______________________________________________
>
> 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


_______________________________________________

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


References: 
 >MyShadow was deallocated while key value observers... (From: Leonardo <email@hidden>)

  • Prev by Date: MyShadow was deallocated while key value observers...
  • Next by Date: Re: MyShadow was deallocated while key value observers...
  • Previous by thread: MyShadow was deallocated while key value observers...
  • Next by thread: Re: MyShadow was deallocated while key value observers...
  • Index(es):
    • Date
    • Thread