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
1
vote
1 answer

NSData getting freed eventhough its used

In below function I am trying to return UIImage pointer which is created from NSData When I give option freeWhenDone = YES the UIImage displayed returned from here is white image. When I give option freeWhenDone = NO UIImage returned form here…
thar_bun
  • 820
  • 1
  • 5
  • 20
1
vote
1 answer

NSMutableData - unrecognized selector sent to instance

I am trying to get data from response. I'm using NSURLConnectionDelegate, NSURLConnectionDataDelegate. The project uses ARC. @interface MainMenu() @property (nonatomic, unsafe_unretained) NSMutableData* wpData; @end…
WantToKnow
  • 1,767
  • 2
  • 12
  • 18
1
vote
2 answers

can't append data to NSMutableData getting segmentation fault 11

here´s the question, I'm receiving data from 2 textfields and I want to append that data into a mutableData to obtain just 1 array and send it through OutputStream. here´s the code I declared as global variable the next NSMutableData*…
Jose Alberto Diaz
  • 155
  • 1
  • 3
  • 12
1
vote
0 answers

NSURLConnection, NSMutableData & Cocoa error 3840

I have a standard asynchronous NSURLConnection operation and NSMutableData that loads json from a web service. - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response { _responseData = [[NSMutableData…
1
vote
2 answers

How to access objects from NSMutableData

I have a NSMutableArray and a NSString . These two are archived to NSData and add to a NSMutableData Object. How can I access each data from NSMutableData Object. NSData *dataArray= [NSKeyedArchiver archivedDataWithRootObject:mutableArray]; NSData…
Vineesh TP
  • 7,755
  • 12
  • 66
  • 130
1
vote
1 answer

What is the standard pattern for tabbar delegates

what is the standard pattern for transfering data using the tabbar?
William Falcon
  • 9,813
  • 14
  • 67
  • 110
1
vote
1 answer

iOS: how to add length of a NSData as its two bytes header?

I have a NSData and I would like to append its length in its header as hex digits. I am able to do this using following code: unsigned int len = [data length]; NSMutableData *sendData = [[NSMutableData alloc] initWithBytes:&len length:2]; [sendData…
m4singh
  • 13
  • 5
1
vote
0 answers

Appending data from downloaded from the web in NSMutableData

I'm trying to append data from a CSV file that I'm getting form the internet. Something is going wrong and I can't figure out what. My log is not returning anything for "Field" or "Value". I'm holding the data as NSMutableData and trying to append…
1
vote
0 answers

NSData stores the same information for differents NSURL

I'm doing a parsing of a XML and my problem begins when i want to store a NSData of an url needed for my parser. This URL contains the user and the password to authenticate (returns a XML), and in my first UIview it's checked this values. Everything…
user1708257
  • 265
  • 1
  • 4
  • 6
1
vote
2 answers

Filling NSMutableData with bytes results in zero length

When setting up NSMutableData like this: NSMutableData* mRgb = [NSMutableData dataWithCapacity:3]; ((char*)[mRgb mutableBytes])[0] = 10; ((char*)[mRgb mutableBytes])[1] = 90; ((char*)[mRgb mutableBytes])[2] = 160; I have the problem that the length…
Boris
  • 8,551
  • 25
  • 67
  • 120
1
vote
2 answers

How to set a byte in NSMutableData

How would I set a byte in an NSMutableData object? I tried the following: -(void)setFirstValue:(Byte)v{ [mValues mutableBytes][0] = v; } But that makes the compiler cry out loud...
Boris
  • 8,551
  • 25
  • 67
  • 120
1
vote
1 answer

Extending NSMutableData class

My question is simple. I want to extend the NSMutableData class in iOS and override some of the methods defined in NSMutableData. For e.g. I want to override writeToFile function with my own wrapper implementation for it. Is it possible to do…
Nirav
  • 315
  • 1
  • 4
  • 16
1
vote
4 answers

Converting XML to NSString

Previously, I was able to get the contents of the URL with this encoding: And parse it into NSString with codes shown below: NSMutableData *receivedData = [[[NSMutableData alloc]…
user1418174
1
vote
1 answer

Crashes while fetching data from filepath

The app crashes while trying to fetch data from path/URL (video file stored in documents folder) only for large files (>100 MB). Device Details: iOS (4.3), iPad 1 URL is perfect (Checked logs) File exists at that path (checked path) Note: Crashes…
Dilip Lilaramani
  • 1,126
  • 13
  • 28
1
vote
2 answers

NSURLConnection crash on releasing NSMutableData

I have followed the instruction from Using NSURLConnection and sometimes (very very seldom) my project crashes in method. - (void) connection:(NSURLConnection *)connection didFailWithError:(NSError *)error { [connection release]; …
iWheelBuy
  • 5,470
  • 2
  • 37
  • 71