myCustomController *controller = [myMutableArray objectAtIndex:page];
NSLog(@"%@",controller); // <- THIS RETURNS NULL IN CONSOLE
if ((NSNull *)controller == [NSNull null]) {
// Why is the above check not working if controller in console says it's null?
// It's not jumping into this loop. Has something changed in iOS4.0 SDK?
}
对null
进行viewController
检查有什么问题,它似乎无法正常工作。
答案 0 :(得分:4)
NSLog
应该在控制台中返回(null)
(可能是nil
的说明),而不是NULL
。您的支票应如下所示:
if (!controller) {
// do some stuff here
}