【发布时间】:2013-07-28 10:57:45
【问题描述】:
我正在为 iOS 7 更新我的应用程序。我有一个导航控制器,其根视图控制器为 UITableView。当我点击一行时,它应该打开一个特定于我点击的行的 nib 文件。我设置的方式如下:
#import "myTableView.h"
#import "wantedNibFile.h"
@implementation myTableView
-(void)tableView:(UITableView*)TableView didSelectRowAtIndexPath:(NSIndexPath*)\
indexPath
NSUInteger row = [indexPath row];
NSString *rowValue = [listData objectAtIndex:row];
if ([rowValue isEqualToString:@"cell text" ]) {
wantedNibFile *thing = [[wantedNibFile alloc]init];
[self.navigationController pushViewController:thing animated:YES];
}
当我运行这个程序时,Xcode 将我带到下面的文本。如果它包含在星号中,则表示调试器将其突出显示为红色。
Undefined symbols for architecture i386:
**"_OBJC_CLASS_$wantedNibFile", referenced from:**
objc-class-ref in myTableView.o
ld: symbol(s) not found for architecture i386
clang: error: **linker command failed with exit code 1 (use -v to see invocation)**
谢谢。
【问题讨论】:
-
什么是“wantedNibFile”?一个类还是一个笔尖?继承自 UIViewController?!?没有人可以通过您的代码来判断,因为您不遵循常见的命名约定。考虑阅读 Apple 的代码命名基础知识:developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/…
标签: iphone objective-c view controller ios7