0
我正在更新我的iOS 7應用程序。我有一個導航控制器的根視圖控制器作爲UITableView。當我點擊一行時,它應該打開一個特定於我製作的行的筆尖文件。我設置它的方式如下:加載視圖控制器的奇怪錯誤
#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的代碼命名基礎知識:https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingBasics.html#//apple_ref/doc/uid/20001281-BBCHBFAH – Tafkadasoh