我试图实现[NSMutableDictionary dictionaryWithObjects:frames forKeys:items]
,但使用CFDictionary,因此我可以控制键和值回调。这是我得到的:Casting'__unsafe_unretained id *'to'const void **'
__unsafe_unretained id keys[itemCount];
[items getObjects:keys range:NSMakeRange(0, itemCount)];
__unsafe_unretained id values[itemCount];
[frames getObjects:values range:NSMakeRange(0, itemCount)];
CFDictionaryCreate(kCFAllocatorDefault, (const void **)keys, (const void **)values, itemCount, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
其中给出以下错误:Cast of an indirect pointer to an Objective-C pointer to 'const void **' is disallowed with ARC
。
我尝试过桥接的各种排列,但我似乎无法让它编译没有投诉。
任何帮助非常感谢!
没有想到在(void *)之前添加(__unsafe_unretained id *),但它对我有用。谢谢! – 2012-05-04 17:22:26