Wednesday, June 29, 2011

Convert Char to NsString and vice versa

char to NsString

char *a = "Testing";
NSString *aa = [NSString stringWithCString: (const char *)a encoding: NSASCIIStringEncoding];NSLog(@"%@", aa);




#############################################

NSString to c char


char * c_string = [someNSString UTF8String];

No comments:

FEEDJIT Live