Reputation: 1829
NSData *finaldata2 =[NSData dataWithContentsOfFile:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"DefaultProfilePhoto.jpg"]];
now when i convert this NSData to NSString at that time i'm getting value null. How to resolve this problem
I need data of my png file into 1 NSString
Upvotes: 0
Views: 253
Reputation: 96927
Every subclass of NSObject
has a -description
method, including NSData
:
NSString *finaldata2String = [finaldata2 description];
For NSData
this will create an NSString
representation of the data, making a string of bytes in hexadecimal format.
Upvotes: 1