views:

48

answers:

2

I have taken char data into database into array. now i want to convert that data into string.

how can i convert array data into NSString.

+1  A: 

If you have a const char * instance, you can use the NSString method + stringWithCString:encoding:. For example:

NSString *_myString = [NSString stringWithCString:_myCharPtr encoding:NSUTF8StringEncoding];

To put that into an NSArray*, you might do the following:

NSArray *_myArray = [NSArray arrayWithObjects:_myString,nil];
Alex Reynolds
A: 

use

[NSString stringWithUTF8String:<#(const char *)nullTerminatedCString#>]

Regards

maxbareis