AppDelegate.h:
@interface AppDelegate : UIResponder <UIApplicationDelegate, UITabBarControllerDelegate>
+ (MBProgressHUD *)showGlobalProgressHUDWithTitle:(NSString *)title;
AppDelegate.m:
+ (MBProgressHUD *)showGlobalProgressHUDWithTitle:(NSString *)title {
UIWindow *window = [[[UIApplication sharedApplication] windows] lastObject];
[MBProgressHUD hideAllHUDsForView:window animated:YES];
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:window animated:YES];
hud.labelText = title;
return hud;
}
AppDelegate.mのsomeOtherMethodでは:
[self showGlobalProgressHUDWithTitle:@"Checking for Updates"]; //No visible interface for AppDelegate declares the selector 'showGlobalProgressHUDWithTitle:'
なんで?インターフェイスの他のメソッドが表示されますが、なぜこれが表示されないのですか?それはクラスメソッドであることに関係がありますか?