Q:

What is the length in bytes of a NSString?

How do I get the bytes length of NSString? if myString contains "hallo", myString.length will return 5, but how many actual bytes are taken?

A:

NSString *test=@"ABCDEFGHIJKLMNOPQRSTUVWXYZ";
NSUInteger bytes = [test lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"%i bytes", bytes);

A:

To get the bytes use 
NSData *bytes = [string dataUsingEncoding:NSUTF8StringEncoding];

Then you can check bytes.length
Number of bytes depend on the string encoding

A:

Well:
NSString* string= @"myString";
NSData* data=[string dataUsingEncoding:NSUTF8StringEncoding];
NSUInteger myLength = data.length;

