2012-07-04 50 views
2

我是這個iPhone開發新手。現在我正在嘗試開發一個靜態庫。我成功創建了這個庫。但是當我試圖訪問一個顯示錯誤 「無法識別的選擇器發送到實例」的函數時遇到了一個問題。當我搜索他們大部分的時候告訴把-objc放在其他鏈接器標誌中,並且forceaall和所有負載。但沒有任何工作。鏈接靜態庫時無法識別的選擇器發送到實例?

我曾經參考過這個網站來開發這個庫。 http://www.icodeblog.com/2011/04/07/creating-static-libraries-for-ios/

回答

0

導致錯誤信息的常見原因是當您調用未在接口類(.h)中聲明或根本不存在的方法時。

@interface YourClass 
//other programmers forget to declare method in header 
-(void)declaredMethod; 
@end 


@implementation YourClass 
-(void)declaredMethod 
    { 
    //this is fine 
    } 
-(void)undeclaredMethod 
    { 
    // declaration in header is missing 
    // will throw exception 
    } 
@end 
+0

我已經聲明,在ma頭文件中,然後也顯示此錯誤 –

相關問題