如果*空指針指向測試以NSObject的我想知道女巫是最好的實踐來檢驗,如果空指針實際上是一個客觀的C對象指針(NSObject的*)...如何在目標C
- (id)initWithExecPath:(NSString*)executePath withArgs:(NSArray*)args identifier:(NSString*)identifierString contextInfo:(void*)contextInfo {
// I would like to check here if contextInfo is an NSObject
}
謝謝...
應該是http://cocoawithlove.com/2010/10/testing-if-arbitrary-pointer-is-valid.html – nielsbot 2011-12-30 08:13:50
謝謝你的帖子,已經檢查過,想知道是否有一個更簡單的方法。 – Vassilis 2011-12-30 08:17:11