1
我的應用程序是一個標籤欄的應用程序。有在底部的兩個標籤和一個按鈕,導致一個新的窗口,第一個選項卡上的電源插座。當我在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];
}
這就是爲什麼我不使用Interface Builder一個很好的例子。這是一個痛苦的尋求幫助......有沒有辦法讓我們判斷你的控件已正確連接到您的選擇... – 2011-06-14 23:32:40
並通過Xcode中顯示哪些錯誤? – 2011-06-14 23:33:58