NSString alloc initWithFormat:formatString参数:argList在64位设备上崩溃

时间:2015-10-01 10:27:57

标签: ios iphone 64-bit iphone-6 iphone-64bit

我有一个工作代码

  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);`

它在32位设备上工作正常,但它在64位设备上崩溃。我唯一可以调试的是argList的大小是64位的8字节空间和32位设备的4字节。 有人遇到过这个问题吗?提前致谢

0 个答案:

没有答案