tags:

views:

24

answers:

1

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

A: 

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.

Alex Reynolds