0

for example i want to covert this to long

NSString *str = @"FFFF00FF";

thanks!

Edgar
  • 179
  • 11

3 Answers3

1

Try to use this one

NSString *str = @"FFFF00FF";
NSScanner* scanner = [NSScanner scannerWithString: str];

unsigned long long longValue;
[scanner scanHexLongLong: &longValue];
NSLog(@"LongValue = %lld", longValue);

i hope it may help you.

Dharmbir Singh
  • 17,277
  • 5
  • 49
  • 66
0
long *longString = [YourString longLongValue];
Nikhila Mohan
  • 1,980
  • 2
  • 15
  • 17
0
NSString *str = @"FFFF00FF";

long longstring=[str longLongValue];

NSLog(@"%ld",longstring);

try this one.mightbe help ful to you.

Jitendra
  • 4,987
  • 2
  • 21
  • 42