У меня есть несколько кодов, как показано ниже
#import <UIKit/UIKit.h>
@interface ViewMoreSettingController : UIViewController < UITableViewDelegate, UITableViewDataSource >
{}
@end
#import "ViewMoreSettingController.h"
@implementation ViewMoreSettingController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
@end
// "MoreController.h"
#import <UIKit/UIKit.h>
@class ViewMoreSettingController;
@interface MoreController : UIViewController <UITableViewDataSource,UITableViewDelegate>{
ViewMoreSettingController *vViewMoreSettingController;
}
@property (retain,nonatomic) ViewMoreSettingController *vViewMoreSettingController;
@end
// ------------------------------ "MoreController.m"
#import "MoreController.h"
#import "ViewMoreSettingController.h"
@implementation MoreController
@synthesize vViewMoreSettingController;
-(void)doSomething
{
ViewMoreSettingController * temController ;
temController=[[ViewMoreSettingController alloc]initWithNibName:@"ViewMoreSetting" bundle:nil];//a: if remove this line it will compile successfully
[self.navigationController pushViewController:vViewMoreSettingController animated:YES];
[temController release];
}
сообщит
Неопределенные символы для архитектуры i386:
"_OBJC_CLASS _ $ _ ViewMoreSettingController", на который ссылаются из:
objc-class-ref в MoreController.o
ld: символ (ы) не найден для архитектуры i386
clang: error: сбой команды компоновщика с кодом выхода 1 (используйте -v для просмотра вызова)
если я уберу строку a: она успешно скомпилируется.
Приветствую любой комментарий