내 응용 프로그램은 탭 모음 응용 프로그램입니다. 하단에는 두 개의 탭이 있고 첫 번째 탭에는 새 창으로 연결되는 버튼이 있습니다. xcode에서 코드를 빌드하면 성공합니다. 시뮬레이터에서 앱을 실행하고 새 창으로 연결되는 버튼을 클릭하면 앱이 다운됩니다. 이것은 "FirstViewController"과 "GuitarBrandsViewController"에 대한 내 코드iPhone 시뮬레이터에서 버튼을 누르면 앱이 다운됩니다. Xcode 3.2.5
입니다 FirstViewController.h-
#import <UIKit/UIKit.h>
#import "GuitarBrandsViewController.h"
@interface FirstViewController : UIViewController {
FirstViewController *firstViewController;
IBOutlet UIWindow *window;
IBOutlet UIWindow *GuitarBrands;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
-(IBAction)gotoGuitarBrands;
@end
FirstViewController.m
#import "FirstViewController.h"
@implementation FirstViewController
@synthesize window;
-(IBAction)gotoGuitarBrands{
GuitarBrandsViewController *screen = [[GuitarBrandsViewController alloc] initWithNibName:nil bundle:nil];
screen.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:screen animated:YES];
[screen release];
}
GuitarBrandsView Controller.h
#import <UIKit/UIKit.h>
#import "FirstViewController.h"
@interface GuitarBrandsViewController : UIViewController {
GuitarBrandsViewController *guitarBrandsViewController;
IBOutlet UIWindow *window;
IBOutlet UIWindow *Main;
}
@property (nonatomic, retain) IBOutlet UIWindow *window;
-(IBAction)gotoMain;
@end
GuitarBrandsViewController.m
#import "GuitarBrandsViewController.h"
@implementation GuitarBrandsViewController
@synthesize window;
-(IBAction)gotoMain{
FirstViewController *screen = [[FirstViewController alloc] initWithNibName:nil bundle:nil];
screen.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:screen animated:YES];
[screen release];
}
인터페이스 빌더를 사용하지 않는 이유의 좋은 예입니다. 도움을 요청하는 것은 고통입니다 ... 귀하의 컨트롤이 선택자와 올바르게 연결되었는지 여부를 알려주는 방법은 없습니다 ... –
xcode에서 표시되는 오류는 무엇입니까? –