This question already has an answer here:
- objective-c: how to assign string to NSMutableData? 4 answers
How to convert a string into mutable data in objective c
This question already has an answer here:
How to convert a string into mutable data in objective c
You can do something like,
NSString *str = @"any string";
NSData *data = [str dataUsingEncoding:NSUTF8StringEncoding];
NSMutableData *mutableData = [data mutableCopy];;
Hope this will help :)
You can convert NSString to NSData by using
NSString* str = @"mystring";
NSData* data = [str dataUsingEncoding:NSUTF8StringEncoding];
NSMutableData *yourdata = [data mutableCopy];
hope it helps you :)