You can convert NSString to NSData by using
NSString* str = @"mystring";
NSData* data = [str dataUsingEncoding:NSUTF8StringEncoding];
NSMutableData *yourdata = [data mutableCopy];
hope it helps you 🙂
More Related Contents:
- How do I check if a string contains another string in Objective-C?
- Generate JSON string from NSDictionary in iOS
- Converting escaped UTF8 characters back to their original form
- All NSUserDefaults, all in tableview
- How to use NSJSONSerialization
- Passing data between view controllers
- How to get IMEI on iPhone?
- How to set lock screen , wallpaper and Ringtone programmatically in iPhone?
- Proper practice for subclassing UIView?
- How do I correctly use “openParentApplication” and “handleWatchKitExtensionRequest” so that “reply()” is called?
- Can UIView be copied?
- What is the difference between Modal and Push segue in Storyboards?
- Why masksToBounds = YES prevents CALayer shadow?
- Creating a UIImage from a UIColor to use as a background image for UIButton [duplicate]
- Present and dismiss modal view controller
- Detect iOS device type
- iOS 7 UITextView vertical alignment
- App not sized properly iOS 8 iPhone simulator
- How to make POST NSURLRequest with 2 parameters?
- Unique Identification of iOS device for iOS 7.0 and above
- UITableView Mix of Static and Dynamic Cells?
- How to determine if an NSDate is today?
- How to handle iphone screen sizes/resolution for background images
- Play video on UITableViewCell when it is completely visible
- EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) on dispatch_semaphore_dispose
- How to reliably detect if an external keyboard is connected on iOS 9?
- import swift class in objective-c, -Swift.h file not found
- AVSpeechSynthesizer in background mode
- UICollectionView current visible cell index
- What size should TabBar images be?