【问题标题】:strange behavior when compile multi controllers project编译多控制器项目时的奇怪行为
【发布时间】:2012-03-22 02:21:04
【问题描述】:

我有一些代码如下

#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”,引用自: MoreController.o 中的 objc-class-ref ld:未找到体系结构 i386 的符号 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

如果我删除第 a 行:它将成功编译。

欢迎评论

【问题讨论】:

    标签: iphone


    【解决方案1】:

    我们最近也遇到了同样的情况。简单的解决方案是仅通过删除参考从项目中删除这些文件,然后再次将这些文件添加到项目中,因为添加现有文件将解决问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多