• 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: filling NSImage with binary data from NSData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: filling NSImage with binary data from NSData


  • Subject: Re: filling NSImage with binary data from NSData
  • From: Lester Dowling <email@hidden>
  • Date: Mon, 8 May 2006 19:22:21 +1000


On 08/05/2006, at 2:10 PM, John Stiles wrote:
Lester Dowling wrote:

The seg fault happens because the image is not planar. Substitute "isPlanar:NO" because according to the manual:


I would think that a grayscale image could be considered either planar or non-planar.

That's what I used to think, too -- it's just what I found to work reliably in my applications. In this case, you're right though because I found the seg fault doesn't happen because of the planar setting.


From the OP, the data file is loaded into a global variable, vmrData, with:

     vmrData = [NSData dataWithContentsOfFile:fileName];

These factory methods return an object marked for auto-release. So, the seg fault happens because the program dereferences this global object when it has already been auto-released. The problem is fixed by substituting this line:

     vmrData = [[NSData dataWithContentsOfFile:fileName] retain];

Regards,
Lester

_______________________________________________
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: filling NSImage with binary data from NSData
      • From: "marc joanisse" <email@hidden>
References: 
 >filling NSImage with binary data from NSData (From: "marc joanisse" <email@hidden>)
 >Re: filling NSImage with binary data from NSData (From: "Greg Herlihy" <email@hidden>)
 >Re: filling NSImage with binary data from NSData (From: "marc joanisse" <email@hidden>)
 >Re: filling NSImage with binary data from NSData (From: Lester Dowling <email@hidden>)
 >Re: filling NSImage with binary data from NSData (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Application for Specific Processors
  • Next by Date: Re: Application for Specific Processors
  • Previous by thread: Re: filling NSImage with binary data from NSData
  • Next by thread: Re: filling NSImage with binary data from NSData
  • Index(es):
    • Date
    • Thread