我想用SSKeychain来拯救CFUUID。但每次我从SSKeychain得到的CFUUID都是零..。我已经在github上阅读了文档,但仍然不知道它出了什么问题。等待帮助~请~~
NSString *retrieveuuid = [SSKeychain passwordForService:@"com.game.userinfo "account:@"uuid"];
if ( retrieveuuid == nil || [retrieveuuid isEqualToString:@""])
{
CFUUIDRef uuid = CFUUIDCreate(NULL);
assert(uuid != NULL);
CFStringRef uuidStr = CFUUIDCreateString(NULL, uuid);
retrieveuuid = [NSString stringWithFormat:@"%@", uuidStr];
[SSKeychain setPassword: retrieveuuid
forService:@"com.game.userinfo"account:@"uuid"];
}发布于 2015-05-06 10:37:22
在"com.game.userinfo "的第一行(在查找UUID时)有一个尾随空格字符,但在设置它时没有在最后一行。这些字符串应该是相同的。
https://stackoverflow.com/questions/30066472
复制相似问题