地址簿常量评估为零 [英] Address Book constants evaluating as zero
问题描述
我有一个程序,对于某些代码路径,地址簿常量(例如kABPersonEmailProperty,kABPersonAddressProperty)评估为其正常的非零值。但是,如果我遵循不同的代码路径,所有这些常量都会计算为零。
I have a program where for certain code paths, the address book constants (such as kABPersonEmailProperty, kABPersonAddressProperty) evaluate to their normal non-zero value. However, if I follow a different code path, all these constants evaluate to zero.
此外,一旦我按照成功的代码路径,如果我采用有问题的代码它运作的路径。
Furthermore, once I follow the "successful" code path, if I take the problematic code path it works.
这是某种编译链接问题吗?
Is this some kind of compile linkage issue ?
我也可能过度释放某个变量。
I could also be over-releasing a variable somewhere.
推荐答案
好的,神秘的解决了。以Apple为荣,记录了这种行为。
Okay, mystery solved. To Apple's credit, the behavior is documented.
参见链接文本
特殊注意事项:这些常量的值未定义,直到其中一个以下内容被称为:ABAddressBookCreate,ABPersonCreate,ABGroupCreate。
"Special Considerations: The value of these constants is undefined until one of the following has been called: ABAddressBookCreate, ABPersonCreate, ABGroupCreate."
这篇关于地址簿常量评估为零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!