我有一个 CFStringRef 变量,我执行检查以确保它不是 1 特定值。如果是,那么我想将其设置为 @"" 的 NSString 等效项
这是代码
CFStringRef data = = CFDictionaryGetValue(dict, kABPersonAddressStateKey);
NSComparisonResult result = [(NSString *)data compare:element options:compareOptions];
if(NSOrderedAscending == result) {
// Do something here...
}
else if (NSOrderedSame == result) {
// Do another thing here if they match...
data = "";
}
else {
// Try something else...
}
所以在 if else 块中,我想将它设置为 "" 但 Xcode 警告我它是一个无效的指针类型。