【发布时间】:2011-05-12 12:29:57
【问题描述】:
我有一个 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 警告我它是无效的指针类型。
【问题讨论】:
标签: ios ios4 nsstring cfstring