Re: MyShadow was deallocated while key value observers...
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