[iOS] clang: error: linker command failed with exit code 1 (use -v to see invocation)

Posted in :

按照別人寫的sample code 完成了客製化tableview 之後:
http://stackoverflow.max-everyday.com/2017/05/ios-tableviewcell-custom-tableviewcell/

程式碼裡,一定不只一個 tableview,  在只有一個 tableview 情況下不會出錯,但多個 tableview  無法build. 原因在變數名稱重覆,第1次遇到這個 error.

發生的原因在 變數的 scope 重覆:

@implementation SimpleTableViewController


NSArray *tableData;

- (void)viewDidLoad

把 tableData 改放到

@interface SimpleTableViewController

@end

裡面就解決了。

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *