NSString alloc initWithFormat:formatString arguments:argList crashing on 64 bit device

140 views Asked by At

I have a working code

  NSRange range = NSMakeRange(0, [arguments count]);
  void *argList = malloc(sizeof(NSObject *) * [arguments count]);
  [arguments getObjects:(id*)(const id *)argList range:range];

  //printf("hello....%lu...",sizeof(argList));
  retVal = [[NSString alloc] initWithFormat:formatString arguments:argList ];
  free(argList);`

it is working fine on 32 bit device,but its crashing on 64 bit devices. The only thing I can debug is that the size of argList is taking 8 byte space in 64 bit and 4 bytes in 32 bit devices. Have anybody faced this issue? Thanks in advance

0

There are 0 answers