1
在*perror = error
行中獲取此值。甚至當我在if (error)
將錯誤分配給錯誤的指針指針時的潛在空引用
- (BOOL)validate:(NSError **)perror password:(BOOL)password {
BOOL ret = YES;
NSMutableString * errorMessage = [@"" mutableCopy];
...other validation code
NSError * error = [NSError errorWithDomain:@"Profile" code:100 userInfo:dictionary];
if (error) {
*perror = error;
}
return ret;
}