Questions tagged [cfdata]

CFData provides support for data objects, object-oriented wrappers for byte buffers.

CFData and its derived mutable type, CFMutableData Reference, provide support for data objects, object-oriented wrappers for byte buffers. Data objects let simple allocated buffers (that is, data with no embedded pointers) take on the behavior of Core Foundation objects. CFData creates static data objects, and CFMutableData creates dynamic data objects. Data objects are typically used for raw data storage.

You use the CFDataCreate and CFDataCreateCopy functions to create static data objects. These functions make a new copy of the supplied data. To create a data object that uses the supplied buffer instead of making a separate copy, use the CFDataCreateWithBytesNoCopy function. You use the CFDataGetBytes function to retrieve the bytes and the CFDataGetLength function to get the length of the bytes.

Read more here.

36 questions
0
votes
1 answer

CFData (store) increases upto 200MB when downloading images throughout NSData -initWithContentsOfURL in Background thread

Im using NSData -initWithContentsOfURL in a background thread to download some 4k images. I can see in Instruments that my CFData (store) keeps growing and goes upto 200MB (at which point btw I crash) although Im using this code to clear the…
Bushra Shahid
  • 3,579
  • 1
  • 27
  • 37
0
votes
1 answer

ImagePickerController crash

In a modal view, i have an imageView in which i set the image from gallery or camera. few times it works perfectly, but as number of selection increases application crashes.I'm using this code -…
kanak
  • 23
  • 4
0
votes
1 answer

iOS Download & Parsing Large JSON responses is causing CFData (store) leaks

The first time a user opens my app I need to download lots of data. I get all of this data from the server in JSON form. Depending on the user, these JSON files can be anywhere from 10kb - 30mb each, and there are 10+ of them. I have no problems…
RyanG
  • 4,393
  • 2
  • 39
  • 64
0
votes
1 answer

Difference between [[NSMutableData alloc] initWithLength:] and CFDataCreateMutable()?

I'm looking at some code that creates a mutable data object and puts a SHA1 hash into it. If I initialize the target mutable data object with CFMutableDataRef hashDataRef = (CFMutableDataRef)[[NSMutableData alloc]…
Isaac
  • 10,668
  • 5
  • 59
  • 68
0
votes
1 answer

compressed CGImage with CGImageDestination truncated after getting bytes

I want to get the compressed data from a CGImageRef to send it over a network connection. To do so, i use a CGImageDestinationRef (CGImageDestinationCreateWithData). After pulling the Data out of the CFDataRef Object the image misses a couple of…
inx
  • 3
  • 2
0
votes
1 answer

implicit conversion of objective c type pointer 'CFDataRef' is disallowed with ARC?

I have a UDP type socket that I created last summer that worked fine, and still runs fine if I open the project file. However I have imported the .h/.m files into a new project, which does have ARC. ARC does not like the following command(used in an…
1 2
3