1

CurrentViewController.h

#import <UIKit/UIKit.h>
#import "nextNavViewController.h"
@interface CurrentViewController : UIViewController 

{
nextNavViewController *contr;
}
- (IBAction)showNavView:(id)sender;

@end

CurrentViewController.m

/*..........*/
- (IBAction)showNavView:(id)sender {
    contr = [[nextNavViewController alloc]initWithNibName:@"nextNavViewController"bundle:nil];
    [self presentViewController: contr animated:YES completion:nil];


}
/* ......... */

nextNavViewController.h

#import <UIKit/UIKit.h>

@interface nextNavViewController : UINavigationController

@end

テーブル、いくつかのボタン、カスタマイズされたナビゲーションバーを含む「nextNavViewController.xib」があります。このインターフェイスをロードしたいのですが、空白のナビゲーションバーと空白の画面がロードされます。

私がしていることは可能ですか?カスタマイズされたインターフェイスをロードするにはどうすればよいですか?

4

1 に答える 1

5

いくつかのこと:

1) クラスの名前に注意してください。Objective-C の標準に従っていることを確認する

2) a をサブクラス化する必要はありませんUINavigationController。の機能の一部を受け取りたい場合は、次のようにしますUINavigationController

contr = [[nextNavViewController alloc]initWithNibName:@"nextNavViewController"bundle:nil];

UINavigationController *myNavigation = [[UINavigationController alloc] initWithRootViewController:contr];

[self presentViewController:myNavigation animated:YES completion:nil];
于 2012-12-11T07:34:09.797 に答える