2013-02-09 2 views
0

Apple에서 제공하는 Rechablity.h 및 Rechablity.h를 사용하고 있으며이 파일을 사용하고이 오류가 발생합니다. "링커 명령이 종료 코드 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

+0

프로젝트를 확장하고 프로젝트에서 누락 될 모든 파일 (가져온 라이브러리 또는 헤더/구현 파일)을 확인하십시오 (구체적으로 빨간색으로 강조 표시됨) –

+0

마지막으로 솔루션을 얻었습니다. <3 – ASHISHT

0

빌드 설정에서 빌드 아키텍처를 사용하여 검색하고 해당 값이 No이면 예로 변경하십시오. 일할 수도 있습니다. 프로젝트와 타겟을 모두 변경해야합니다.

+0

아니요, 이것이 작동하지 않습니다. – ASHISHT

관련 문제