ios - crash on [GetReturnValue:] method is used to obtain OC object, help me -
using [code 1]【 getreturnvalue :】 ios reflection oc object, in
【iphone4s + ios8.4】、【 iphone 4 + ios7.1】 (crash),
【iphone6 + ios9.3】、【 iphone 5 + ios8.4.1】 (pass),
but implement following [code 2] on of systems test pass, 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 deallocated instance 0x7baa7460
crash screenshot :enter image description here
test demo download link https://github.com/leopardpan/issuesdemo
Comments
Post a Comment