2013-02-09 56 views
0

我使用的是Apple提供的Rechablity.h和Rechablity.h,並使用這些文件並添加了一些代碼,如nd得到這個錯誤「鏈接器命令失敗,退出代碼1(使用-v來查看調用)」

#pragma mark Rechability method 

/** 
* reachabilityChanged() 
* @desc Check the internet connection 
* @param NSNotification note is the notification of internet state changed 
*/ 

- (void) reachabilityChanged: (NSNotification*)note { 

Reachability* curReach = [note object]; 
NSParameterAssert([curReach isKindOfClass: [Reachability class]]); 
[self updateInterfaceWithReachability: curReach]; 
} 

/** 
* updateInterfaceWithReachability() 
* @desc Update the internet connection state 
* @param Reachability curReach is the instance of Reachbility 
*/ 

- (void) updateInterfaceWithReachability: (Reachability*) curReach { 

if(curReach == internetReach) { 

    NetworkStatus netStatus = [curReach currentReachabilityStatus]; 
    BOOL connectionRequired = [curReach connectionRequired]; 
    NSString* statusString = @""; 

    switch (netStatus) { 

     case NotReachable: { 

      statusString = @"Access Not Available"; 
      connectionRequired = NO; 
      isInternetAvailable = FALSE; 
      break; 
     } 

     case ReachableViaWWAN: { 

      statusString = @"Reachable WWAN"; 
      isInternetAvailable = TRUE; 
      break; 
     } 

     case ReachableViaWiFi: { 

      statusString = @"Reachable WiFi"; 
      isInternetAvailable = TRUE; 
      break; 
     } 
    } 

    if(connectionRequired) 
     statusString = [NSString stringWithFormat: @"%@, Connection Required", statusString]; 
    //UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Gmmabling Gambit" message:statusString delegate:nil cancelButtonTitle:nil otherButtonTitles:@"Ok",nil]; 
    //  [alert show]; 
    //  [alert release]; 
    //NSLog(@"%@",statusString); 
} 
} 

/** 
* internetCheck() 
* @desc store the internet connection state 
* @return BOOL internet is available or not 
*/ 

- (BOOL)internetCheck { 

return isInternetAvailable; 
} 

新增systemConfiguration.framework和Security.framework 但是當你沒有在bundle resources添加.m file有這種類型的錯誤

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

回答

0

的這個錯誤通常出現。 所以你可以交叉檢查這些文件是否被添加或者添加實現文件。 您可以將構建階段做同樣的 - >編譯資源,然後添加.m文件

讓我知道,如果它的工作原理:)

希望這有助於!

+0

在編譯資源已經添加 – ASHISHT 2013-02-09 15:08:25

+0

剛剛展開項目,並檢查是否有任何文件將從您的項目中失蹤(進口庫或任何頭/執行文件)這個文件(用紅色特別強調) – 2013-02-11 04:58:22

+0

最後我得到的解決方案同樣感謝大家的支持<3 – ASHISHT 2013-02-11 10:03:25

0

在構建設置中,使用構建體系結構進行搜索,如果該值爲否,則替換爲是。可能是作品。你必須改變項目和目標。

+0

不,這不起作用 – ASHISHT 2013-02-09 13:58:18

相關問題