メイン・メニューのために、私のアプリケーションにmainWindow.xibがあり、その中にTabControllerがあります。iOS:ログインフォームの表示方法
私のアプリケーションのログインフォームが必要です。 は、私はビュー(LoginViewController)を添加し、初めに、このビューを表示:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
// Add the tab bar controller's current view as a subview of the window
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
LoginViewController *lvc = [[LoginViewController alloc] initWithNibName:@"LoginViewController" bundle:nil];
lvc.delegate = self;
[self.tabBarController presentModalViewController:lvc animated:false];
[lvc release];
return YES;
}
次私は大丈夫、ビューに自分のログインチェックを持っています。
この後、私はこのビューを閉じようとします。私の周りを検索し、ここで問題見つかっこのため :
#import <UIKit/UIKit.h>
@interface Animexx3AppDelegate : NSObject <UIApplicationDelegate,
UITabBarControllerDelegate, LoginViewControllerDelegate>
{
UIWindow *window;
UITabBarController *tabBarController;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;
@end
ラインで「プロトコルLoginViewControllerDelegateを見つけることができません」という意味:present modal view controller
私は私のプロジェクトにすべてのものを追加しますが、このコードではエラーを取得2/3。私は、 『互換性のない型から『ID「に割り当てる』Animexx3AppDalagte』私に語った警告が表示されます。
Imが間違っていたか?
'false'ブールリテラルをCocoaと同じリテラルである' NO'に変更してください。私のようなObjective-Cプログラマは、あなたのコードがよく読まれていることに気づくでしょう。 – PeyloW