我有这段代码:
-(NSMutableDictionary *)getAttributesDictionary:(BOOL)privateKey{
NSMutableDictionary * query = [[NSMutableDictionary alloc] init];
CFTypeRef tag = (__bridge CFTypeRef)((privateKey) ? [self privKeyTag] : [self pubKeyTag]);
NSLog(@"Tag: %@",tag);
[query setObject:(__bridge id)kSecClassKey forKey:(__bridge id)kSecClass];
//This is where the crash happens...
[query setObject:(__bridge id)(tag) forKey:(__bridge id)kSecAttrApplicationTag];
[query setObject:[NSNumber numberWithBool:YES] forKey:(__bridge id)kSecReturnData];
return query;
}
在我的iPhone 5S(64位)或32位模拟器上运行时,它运行正常。但是,如果我在64位模拟器上运行它,它会因错误EXC_BAD_ACCESS(代码= EXC_i386_GPFLT)而崩溃。
有人知道为什么吗?