Xcodeでアプリケーションを作成しようとしています。別のここでXcodeのヘルプ - 'secondview'クラスの実装が正しくありません+ '-switchview:'のメソッド定義が見つかりません
は "switchviewcontroller.h" ファイルのコードです:
#import <UIKit/UIKit.h>
@interface SwitchViewController : UIViewController {
}
-(IBAction)switchview:(id)sender;
@end
-----------------------------------------------------------------
And here is the "switchviewcontroller.m" file code:
----------------------------------------
#import "SwitchViewController.h"
#import "secondview.h"
@implementation SwitchViewController
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return YES;
}
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
if((fromInterfaceOrientation == UIInterfaceOrientationLandscapeLeft) ||
(fromInterfaceOrientation == UIInterfaceOrientationLandscapeRight))
{
[[secondview alloc] initWithNibName:@"secondview" bundle:[NSBundle mainBundle]];
}
}
私は2つの警告が質問に示し、それはまた、動作しません取得します。
コードは、私はあなたが言ったことをやったと私は2つのエラーが出て、右ennuikiller – Baccalad
おかげで正しく表示されないように:「」didRotateFromInterfaceOrientation「(この機能で最初に使用する)宣言されていない」+「期待';' before: 'トークン' – Baccalad