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

NSMutableData to NSString

Hi everyone I'm working with symmetric encryption in my app to encrypt messages that users send to each other. Now I'm trying to create a fairly secure key to decrypt this data (decryption key) using an NSMutableData. Currently I have two…
kAiN
  • 2,559
  • 1
  • 26
  • 54
0
votes
1 answer

find item and then remove it in NSMutableData array

I have NSMutableData array of bytes. I need to find item and then delete it. my code: NSArray *array = [[tunerButtonHostInfo objectForKey:@"local"] objectForKey:@"snPacket"]; NSMutableData *asciiData = [[NSMutableData alloc] init]; [asciiData…
0
votes
1 answer

Extract the latest 100 entries from Cocoa Lumberjack log

My app is using Cocoa Lumberjack as logging framework, it creates several log files that need to be aggregated. At some point I need to send debug data as an E-Mail attachment. The entire log is too long, how do I get the latest 100 log…
Peter G.
  • 7,816
  • 20
  • 80
  • 154
0
votes
1 answer

Swift 3 Data to NSMutableData

i am writing an extension to decrypt my NSMutableData , extension NSMutableData { func decrypt() -> NSData { let decryptMethod = (User.sharedInstance.data?.encrypt_method)! let key = User.sharedInstance.defaultKey() …
Alex Wang
  • 71
  • 8
0
votes
2 answers

Objective C - What is better pass a ref to NSData or use NSMutableData

I am developing an API that returns an NSData to the caller. I need the object to be provided in the function parameters (not as a return value). Which of the approach below is preferred and why? NSData* data; [self…
liorco
  • 1,483
  • 1
  • 9
  • 12
0
votes
2 answers

How do I add an NSString to NSMutableData?

I cannot figure out how to add my NSString to an NSMutableData structure this is what I want to achieve, below is hardcoded and works, you can see the number string is what I want to replace with dynamic data from a helper function I…
Matt Douhan
  • 2,053
  • 1
  • 21
  • 40
0
votes
1 answer

How can I avoid data corruption with multiple instances of NSUrlConnection

I have written an iOS app that calls NSUrlConnection multiple times to download image data from the web. Sometimes, one NSUrlConnection has not finished before the other starts. I am seeing corrupt jpeg data and I think it is because my…
Jackson
  • 3,555
  • 3
  • 34
  • 50
0
votes
1 answer

Searching an NSMutableArray with a String and returning the entire compared Array

it seems my Problem isn't a problem for anybody eles because I havend fount anything about it. so it maybe isn't such a big Problem but for me it is. I have this MutableArray filled with alot of data from an XML file. -Name -Age -Address The…
zim
  • 47
  • 1
  • 2
  • 8
0
votes
1 answer

How to append NSData to NSData in Objective-C?

I m going to append NSData to NSData in Objective-C. How can I do it?
gstream
  • 525
  • 6
  • 18
0
votes
0 answers

Can't modify file programmatically objective-c

I'm trying to rewrite a file from which I get data I operate with. But I get an error which says that I have no permission to alter it or delete. Here I'm getting data: - (id) init { if (self = [super init]) { NSError *error = nil; NSString…
AOY
  • 355
  • 3
  • 22
0
votes
1 answer

NSMutableData or NSMUtableArray?

my problem is, i have a NSMutableArray of 3 objects : [myMutableArray insertObject :Obj1 atIndex:0]; [myMutableArray insertObject :Obj2 atIndex:1]; [myMutableArray insertObject :Obj3 atIndex:3]; And then, insert atIndex0 the Obj3. After that, i…
miDark
  • 83
  • 9
0
votes
1 answer

NSInvalidArgumentException: *** -[NSConcreteMutableData initWithCapacity:]: absurd capacity: 3794795864, maximum size: 2147483648 bytes

My iOS app is downloading a very large zip file (of 3.79GB) using AFNetworking. My app also used Flipboard's FLEX library 2.2 to monitor the network traffic. A user reported that once the app trigger the download request, the app crashes with the…
chubao
  • 5,871
  • 6
  • 39
  • 64
0
votes
0 answers

How to get back a float when added as bytes to a NSMutableData

I am appending floats to a NSMutable to get a bytestream of a lot of floats. for var i=0 ;i < 10000 ;i++{ let myfloat=floatarray[i]; testdata.appendBytes(&myfloat, length: sizeof(Float)); } How do I get the array back from that stream…
mcfly soft
  • 11,289
  • 26
  • 98
  • 202
0
votes
1 answer

Working of NSMutableData

I am new to ios development. Please tell me what is NSMutableData and How it works? I have been searching for this question but have not got any perfect answer.
Kirti
  • 573
  • 2
  • 8
  • 18
0
votes
0 answers

Image didn't place in server side using multipart?

In my code i am trying to add string and images in server side but strings are getting placed image didn't get stored in to server... if (internetStatus != NotReachable) { //set content type for http request …
Kishore Kumar
  • 4,265
  • 3
  • 26
  • 47