Converting NSString to UTF8String | iOS Programmer Guide

we can convert an NSString to UTF8String and assign it to a variable of type 'char' as given in the below objective-c code snippet

 NSString *string = @"abc";

 const char *chars = [string UTF8String];