I have a NSString with hex string like \"68656C6C6F\" which means \"hello\".
Now I want to convert the hex string into another NSString object which shows \"hello\"
I think the people advising initWithFormat is the best answer as it's objective-C rather than a mix of ObjC, C.. (although the sample code is a bit terse).. I did the following
unsigned int resInit = 0x1013;
if (0 != resInit)
{
NSString *s = [[NSString alloc] initWithFormat:@"Error code 0x%lX", resInit];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Initialised failed"
message:s
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];
[s release];
}