代码:
// Add the password to the dictionary, converting from NSData to NSString.
NSString *password = [[[NSString alloc] initWithBytes:[passwordData bytes] length:[passwordData length]
encoding:NSUTF8StringEncoding] autorelease];
[returnDictionary setObject:password forKey:(id)kSecValueData];
出错:
ARC forbids explicit message send of ‘autorelease’
如图:
搜:
encoding NSUTF8StringEncoding ARC forbids explicit message send of ‘autorelease’
iOS编程过程中出错:’autorelease’ is unavailable
ios开发之路十一(ARC forbids explicit message send of ‘autorelease’错误) – Lves Li – 博客园
还是使用ARC,
去改为:
// NSString *password = [[[NSString alloc] initWithBytes:[passwordData bytes] length:[passwordData length]
// encoding:NSUTF8StringEncoding] autorelease];
NSString *password = [[[NSString alloc] initWithBytes:[passwordData bytes] length:[passwordData length]
encoding:NSUTF8StringEncoding] init];
即可。
转载请注明:在路上 » [已解决]swift代码出错: ARC forbids explicit message send of ‘autorelease’