我目前正在编写一个iPhone应用程序,它使用UITabBarController和5个以上的标签栏项目。因此,会自动生成一个“更多”标签(如在YouTube应用程序中)。 我发现相应的视图控制器类是UIMoreListController,但我没有任何对应的.h文件。因此,我的代码如下所示:如何禁用前向类编译器警告(无证类)
@class UIMoreListController; // can't use #import since .h file is missing
@implementation SomeUINavigationControllerDelegate
- (void)navigationController:(UINavigationController *)navigationController
willShowViewController:(UIViewController *)viewController
animated:(BOOL)animated
{
if ([viewController isKindOfClass:[UIMoreListController class]])
... // do something if "more" view is active
这种方式就像一种魅力。然而,编译器不断给我
警告:接收机“UIMoreListController”是一个正向类和相应的@interface可能不存在
是否有摆脱这一警告的一种巧妙的方法(这只有特定的警告)?再次,我不能使用#import,因为没有.h文件可用。
你是对的。我决定使用不同的方法: http://pastebin.com/f28191612 这足以检测UIMoreListController,我希望。 – user123444555621 2009-01-14 15:27:54