• 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: EXC_BAD_ACCESS on NSImageView::setImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EXC_BAD_ACCESS on NSImageView::setImage


  • Subject: Re: EXC_BAD_ACCESS on NSImageView::setImage
  • From: Dev <email@hidden>
  • Date: Sun, 15 Mar 2009 10:08:43 -0700

I just change my NSWindow from NSBackingStoreBuffered to a NonRetain one and my
application do not crash anymore.

Unfortunatly, as expected, my window is clipping .... how ever i just
realize that the crash might have a relation with the NSWindow double
buffer mechanism.

So my solution to the problem was instead of replacing the NSImage
using setImage,
i grab directly my NSImage from the View, then pick the representation
and write
directly into it.

It is as a matter of fact, a way better effective way of doing what i
was doing and
it's avoiding all my release problems.....

thx
--
I.

On Sat, Mar 14, 2009 at 12:37 PM, Volker in Lists
<email@hidden> wrote:
> Hi,
>
> retainCount is not in anyway useful when debugging - I had many cases of rc
>> 5 with the object being gone the next instance. your error sounds like you
> loose the image at some point in time. retain it and use Instruments to see
> if you leak or over alloc.
>
> Volker
>
> Am 14.03.2009 um 01:23 schrieb Dev:
>
>> On Wed, Mar 11, 2009 at 9:33 AM, Scott Ribe <email@hidden>
>> wrote:
>>>
>>> Does your setImage method retain the image?
>>>
>> The object ExternalView is a NSImageView so the setImage is the one of
>> NSImageView.
>> The doc says nothing about it, but i added some debug log like this :
>>
>>                      NSLog(@"BEFORE : %d", [NewDisplayImage retainCount]);
>>                      [CameraView setImage:NewDisplayImage];
>>                      NSLog(@"AFTER : %d", [NewDisplayImage retainCount]);
>>
>> 2009-03-13 17:17:35.105 xxx[2281:e503] BEFORE : 1
>> 2009-03-13 17:17:35.106 xxx[2281:e503] AFTER : 3
>>
>> So i guess the image have been retained 2 times ....
>> --
>> I.
>> _______________________________________________
>>
>> 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

  • Follow-Ups:
    • Re: EXC_BAD_ACCESS on NSImageView::setImage
      • From: Dev <email@hidden>
References: 
 >EXC_BAD_ACCESS on NSImageView::setImage (From: Dev <email@hidden>)
 >Re: EXC_BAD_ACCESS on NSImageView::setImage (From: Scott Ribe <email@hidden>)
 >Re: EXC_BAD_ACCESS on NSImageView::setImage (From: Dev <email@hidden>)
 >Re: EXC_BAD_ACCESS on NSImageView::setImage (From: Volker in Lists <email@hidden>)

  • Prev by Date: Changing a custom field editor's position
  • Next by Date: Re: EXC_BAD_ACCESS on NSImageView::setImage
  • Previous by thread: Re: EXC_BAD_ACCESS on NSImageView::setImage
  • Next by thread: Re: EXC_BAD_ACCESS on NSImageView::setImage
  • Index(es):
    • Date
    • Thread