Using [code 1]【 getReturnValue :】 iOS reflection OC object, in the
【iPhone4s + iOS8.4】、【 iphone 4 + iOS7.1】 (crash),
【iPhone6 + iOS9.3】、【 iphone 5 + iOS8.4.1】 (pass),
But i implement the following [code 2] on all of systems test pass, is that a system bug or other reson?
// code 1
id objcMinor;
if( !strcmp(minorReturnType, @encode (id)) )
{
[invoMinor getReturnValue:&objcMinor];
}
// code 2
void *temp = NULL;
[objcMinor getReturnValue:&temp];
id objcMinor = (__bridge id)temp;
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
[dic setObject:objcMinor forKey:@"minor"];
[[NSUserDefaults standardUserDefaults] setObject:dic forKey:@"test"];
edit Xcode scheme->run->enable Zombile objects
console output
*** -[CFNumber release]: message sent to deallocated instance 0x7baa7460
crash screenshot :enter image description here
test demo download link https://github.com/leopardpan/IssuesDemo