重启后iPhone4 SecItemCopyMatching返回-25300 [英] iPhone4 SecItemCopyMatching returns -25300 after reboot

查看:781
本文介绍了重启后iPhone4 SecItemCopyMatching返回-25300的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的方法:

+(SecKeyRef)getKeyByTagWithoutAlert:(NSString *)keyTag status:(OSStatus *) status{
    *status = noErr;
    SecKeyRef key = NULL;

    NSMutableDictionary *queryKey = [[NSMutableDictionary alloc] init];

    // Set the key query dictionary.
    [queryKey setObject:(id)kSecClassKey forKey:(id)kSecClass];
    [queryKey setObject:[SecKeyUtility getDataByTag:keyTag] forKey:(id)kSecAttrApplicationTag];
    [queryKey setObject:(id)kSecAttrKeyTypeRSA forKey:(id)kSecAttrKeyType];
    [queryKey setObject:[NSNumber numberWithBool:YES] forKey:(id)kSecReturnRef];

    *status = SecItemCopyMatching((CFDictionaryRef)queryKey, (CFTypeRef *)&key);

    [queryKey release];
    return key;
}

在我重启iPhone4之前它一切正常。在此SecItemCopyMatching返回错误代码为-25300并且我的应用程序停止正常工作。在iPhone3上我没有这个问题,只是工作完美。
你能帮助我吗?

And it works fine until I restart my iPhone4. After this SecItemCopyMatching returns error with code -25300 and my app stoping work properly. On iPhone3 I don't have this problem, just work perfect. Can you help me?

对不起我的英语。

推荐答案

错误 25300 errSecItemNotFound ,这意味着没有这样的项目在您的钥匙链中。

Error 25300 is errSecItemNotFound, which means that there is no such item in your key chain.

这篇关于重启后iPhone4 SecItemCopyMatching返回-25300的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆