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,485
  • 5
  • 50
  • 66
0
long *longString = [YourString longLongValue];
Nikhila Mohan
  • 2,000
  • 2
  • 15
  • 19
0
NSString *str = @"FFFF00FF";

long longstring=[str longLongValue];

NSLog(@"%ld",longstring);

try this one.mightbe help ful to you.

Jitendra
  • 5,055
  • 2
  • 22
  • 42