2013-03-23 58 views

回答

3

opts是一個枚舉(在這種情況下)基本上是和unsigned int,所以通過0

2

https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Constants/Reference/reference.html#//apple_ref/doc/c_ref/NSEnumerationOptions

仔細閱讀本方法NSArray的文檔,然後單擊NSEnumerationOptions在原文鏈接。

NSEnumerationOptions

爲阻止枚舉操作選項。

enum { 
    NSEnumerationConcurrent = (1UL << 0), 
    NSEnumerationReverse = (1UL << 1), 
}; 
typedef NSUInteger NSEnumerationOptions; 

顯然這是一個NSUInteger位掩碼。 0或上述一個或兩個,但NSEnumerationConcurrent被指出只是一個提示,並不能保證。

nil不是NSUInteger。並非所有的方法參數都是對象。只有當對象參數是可選的時候才應該傳遞nil

相關問題