0

質問があります..xcodeプロジェクトでこれを取得しました:

#輸入

int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);  -> Thread 1: Signal SIGABRT
[pool release];
return retVal;

}

そして私は本当にこれを修正する方法を知りません..私を助けてください!!

ヘッダ:

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>#import "RootA.h"
#import "RootB.h"
#import "RootC.h"
#import "RootD.h"
#import "RootE.h"
#import "RootF.h"
#import "RootG.h"



@interface TabOneViewController : UIViewController {

}
- (IBAction)switchViewsToRootA:(id)sender;

- (IBAction)switchViewsToRootB:(id)sender;

- (IBAction)switchViewsToRootC:(id)sender;

- (IBAction)switchViewsToRootD:(id)sender;

- (IBAction)switchViewsToRootE:(id)sender;

- (IBAction)switchViewsToRootF:(id)sender;

- (IBAction)switchViewsToRootG:(id)sender;

@end

主要:

#import "TabOneViewController.h"


@implementation TabOneViewController

- (IBAction)switchViewsToRootA:(id)sender {

 UIBarButtonItem *mainButton = [[UIBarButtonItem alloc] 
 initWithTitle:@"Back" 
 style:UIBarButtonItemStyleBordered 
 target:self
 action:@selector(mainMenu:)];
 self.navigationItem.backBarButtonItem = mainButton;
 [mainButton release];

RootA *rootA = [[RootA alloc] initWithNibName:@"RootA" bundle:nil];
[self.navigationController pushViewController:rootA animated:YES];
[rootA release];


}

- (IBAction)switchViewsToRootB:(id)sender {

UIBarButtonItem *mainButton = [[UIBarButtonItem alloc] 
                               initWithTitle:@"Back" 
                                   style:UIBarButtonItemStyleBordered 
                               target:self
                               action:@selector(mainMenu:)];
self.navigationItem.backBarButtonItem = mainButton;
[mainButton release];

RootB *rootB = [[RootB alloc] initWithNibName:@"RootB" bundle:nil];
[self.navigationController pushViewController:rootB animated:YES];
[rootB release];
}   

- (IBAction)switchViewsToRootC:(id)sender {

UIBarButtonItem *mainButton = [[UIBarButtonItem alloc] 
                               initWithTitle:@"Back" 
                               style:UIBarButtonItemStyleBordered 
                               target:self
                               action:@selector(mainMenu:)];
self.navigationItem.backBarButtonItem = mainButton;
[mainButton release];

RootC *rootC = [[RootC alloc] initWithNibName:@"RootC" bundle:nil];
[self.navigationController pushViewController:rootC animated:YES];
[rootC release];
}   

- (IBAction)switchViewsToRootD:(id)sender {

UIBarButtonItem *mainButton = [[UIBarButtonItem alloc] 
                               initWithTitle:@"Back" 
                               style:UIBarButtonItemStyleBordered 
                               target:self
                               action:@selector(mainMenu:)];
self.navigationItem.backBarButtonItem = mainButton;
[mainButton release];

RootD *rootD = [[RootD alloc] initWithNibName:@"RootD" bundle:nil];
[self.navigationController pushViewController:rootD animated:YES];
[rootD release];
}   

- (IBAction)switchViewsToRootE:(id)sender {

UIBarButtonItem *mainButton = [[UIBarButtonItem alloc] 
                               initWithTitle:@"Back" 
                               style:UIBarButtonItemStyleBordered 
                               target:self
                               action:@selector(mainMenu:)];
self.navigationItem.backBarButtonItem = mainButton;
[mainButton release];

RootE *rootE = [[RootE alloc] initWithNibName:@"RootE" bundle:nil];
[self.navigationController pushViewController:rootE animated:YES];
[rootE release];
}   

- (IBAction)switchViewsToRootF:(id)sender {

UIBarButtonItem *mainButton = [[UIBarButtonItem alloc] 
                               initWithTitle:@"Back" 
                               style:UIBarButtonItemStyleBordered 
                               target:self
                               action:@selector(mainMenu:)];
self.navigationItem.backBarButtonItem = mainButton;
[mainButton release];

RootF *rootF = [[RootF alloc] initWithNibName:@"RootF" bundle:nil];
[self.navigationController pushViewController:rootF animated:YES];
[rootF release];
}   

- (IBAction)switchViewsToRootG:(id)sender {

UIBarButtonItem *mainButton = [[UIBarButtonItem alloc] 
                               initWithTitle:@"Back" 
                               style:UIBarButtonItemStyleBordered 
                               target:self
                               action:@selector(mainMenu:)];
self.navigationItem.backBarButtonItem = mainButton;
[mainButton release];

RootG *rootG = [[RootG alloc] initWithNibName:@"RootG" bundle:nil];
[self.navigationController pushViewController:rootG animated:YES];
[rootG release];
}   


    #pragma mark -
    #pragma mark Table view data source

        - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
        // Return the number of sections.
        return 1;
    }


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    // Return the number of rows in the section.
    return 1;
}


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }

    // Configure the cell...

    return cell;
}




#pragma mark -
#pragma mark Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // Navigation logic may go here. Create and push another view controller.
    /*
    <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
    // ...
    // Pass the selected object to the new view controller.
    [self.navigationController pushViewController:detailViewController animated:YES];
    [detailViewController release];
    */
}


#pragma mark -
#pragma mark Memory management

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Relinquish ownership any cached data, images, etc. that aren't in use.
}

- (void)viewDidUnload {
    // Relinquish ownership of anything that can be recreated in viewDidLoad or on demand.
    // For example: self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}


@end
4

1 に答える 1

1

IBOutletが IB に接続され、その ivar が削除されたために、このエラーが発生することがあります。すべての IBOutlets が正しく接続されていることを確認します。

viewDidLoad次に、viewcontrollerviewWillAppearまたはviewDidAppearメソッドにバグのあるコードがないかどうかを確認します。

于 2012-11-03T15:15:41.420 に答える