Questions tagged [nsmutabledata]

NSMutableData (and its superclass NSData) provide data objects, object-oriented wrappers for byte buffers. It is available in OS X v10.0 and later and available in iOS 2.0 and later .Use this tag [tag:NSMutableData] for questions referring to NSMutableData in OS X or iOS platform .

From Apple Official Document NSMutableData class reference (and its superclass NSData) provide 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 Foundation objects. They are typically used for data storage and are also useful in Distributed Objects applications, where data contained in data objects can be copied or moved between applications.

NSData creates static data objects, and NSMutableData creates dynamic data objects. You can easily convert one type of data object to the other with the initializer that takes an NSData object or an NSMutableData object as an argument.

For more information : NSMutableData Class Reference

Related SO Questions:

NSMutableData remove bytes?

Is it okay to call +[NSData dataWithData:] with an NSMutableData object?

Related tags:

155 questions
0
votes
2 answers

Amazon S3 (AWS ) NSMutableData

I have a project related on Amazon S3 DOWNLOADING big file sizes above 50MB. It stops without error and I chunk the file into smaller memory due to it's large data file size and download it simultaneously. When I append the chunk data into single…
Cjames
  • 1,852
  • 1
  • 20
  • 23
0
votes
2 answers

Key-Value Observing with NSMutableData iOS

In my model I have NSMutableData Object called data. I want to observe it from another object and get a notification when data is added or removed. I understand that this is a to-many relationship, so I can't use the normal KVO by first adding the…
Jim Craane
  • 186
  • 3
  • 10
0
votes
2 answers

populating a tableview with nsmutabledata received from a webservice

I would like to populate a tableview with a NSMutableData that received from a webservice. I can get the data and display at several components but cannot fill the tableview because following code doesn't accept NSMutableData ; AnyNSarray =…
Murat Calim
  • 580
  • 1
  • 6
  • 11
0
votes
1 answer

Xcode NSURLConnection NSMutableData appdendData only works sometimes

I'm having a strange problem reading a response from an api. In connectionDidFinishLoading, when logging the response as a string [NSString stringWithUTF8String:[self.response bytes]], the string sometimes is logged correctly, sometimes is null,…
Justin McCandless
  • 621
  • 1
  • 10
  • 20
0
votes
3 answers

NSData bytes from integer

I have an integer, with a value of 2. I append that to an NSMutableData object with: [data appendBytes:&intVal length:2]; The number 2 is the number of bytes I want from the int. When I log the data, what I want to see is <0002> (one empty byte…
btomw
  • 2,512
  • 2
  • 20
  • 25
0
votes
0 answers

NSMutableData replaceBytes vs appendData

In terms of performance (speed and memory consumption) . What do you prefer? CASE1: Attaching NSData to the beginning of some NSMutableData. CASE2: Attaching NSData to the end of some NSMutableData. CASE3: (This one goes obviously to…
Hasib Samad
  • 1,081
  • 1
  • 20
  • 39
0
votes
3 answers

Combining two separate JSON data objects into one in Objective C

Im trying to get 2 separate JSON data objects containing 2 twitter users feeds but am having lots of trouble. I want to process them both at the same time and put them into a table but am having difficulties. I have a global NSMutableData that gets…
user1257220
  • 187
  • 1
  • 1
  • 6
0
votes
1 answer

NSMutabledata byte capacity

Possible Duplicate: NSMutableData dissapearing When I have a NSMutableData variable, in my program, it always dumps its content when it has 90810 bytes. Does the number of byte in the data cause the data to be lost? here is the code. -…
0
votes
1 answer

NSMutableData disappearing

in my Program, I have a NSMutableData variable that collect the information from http://www.nhara.org/scored_races-2013.htm. After about the third time it gets information from a website, when it contains 90810 bytes, it either disappears or becomes…
0
votes
2 answers

NSMutableData setLength:NSUInteger crashing the app

Trying to create a connection of a request with an URL. An NSMutableData instance (responseData) also gets called with it. When the connection starts receiving response, the setLength:NSUInteger method gets called up on the NSMutableData Instance.…
Zen
  • 3,047
  • 1
  • 20
  • 18
0
votes
1 answer

Error in connectionDidFinishLoading that I can resolve

I have a simple JSON array that is returned from a zip code passed to a third party service. http://api.geonames.org/findNearbyPostalCodes?postalcode=94115&country=US&radius=5&username=frequentz I get an unknown error when trying to deserialize the…
brianhevans
  • 1,183
  • 4
  • 15
  • 28
0
votes
1 answer

NSMutableData to int conversion bugged in iOS 6?

I've this following code segment. The output for the integer variable comes as expected in iOS 5, but some irregular output is coming in iOS 6! Can anyone please explain what's happening? int XmlMsgSubType; [XmlMsgSubTypeData getBytes:&XmlMsgSubType…
Asif Asif
  • 1,511
  • 14
  • 24
0
votes
1 answer

How do I define NSMutableData instance for NSURLConnection?

From https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html#//apple_ref/doc/uid/20001836-BAJEAIEE NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest…
adamek
  • 2,324
  • 3
  • 24
  • 38
0
votes
2 answers

Daisy-chaining NSMutableData containers

I am retrieving a fairly large amount of text from a webpage and I would like to build multiple NSMutableData instances with it, of a certain size each. What I am not sure about is how to move on to the second NSMutableData object once the first one…
zeeple
  • 5,509
  • 12
  • 43
  • 71
0
votes
1 answer

ObjC: Append data to NSMutableData, byte count inconsistent?

There's this NSMutableData *dump to which I must append some NSData *chunk. chunk is 440 bytes and contains the raw bytes read from a file. The file also weights 440 bytes. Good so far. Now, I must append this: NSMutableData *dump = [NSMutableData…
Jem
  • 6,226
  • 14
  • 56
  • 74