Xcode:Apple Mach-O链接器错误:架构i386的未定义符号

时间:2012-12-14 11:14:12

标签: xcode

这是我的代码。运行此时,我得到以下错误。,,

  

架构i386的未定义符号:
    “_OBJC_CLASS _ $ _ Reachability”,引自:         ASKViewController.o中的objc-class-ref   ld:找不到架构i386的符号
  clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

-(void) checknetork{

    Reachability *reach=[Reachability reachabilityWithHostName:@"http://www.google.com.sg"];
    NetworkStatus netstatus=[reach currentReachabilityStatus];
    bool net;
    switch (netstatus)
    {
        case NotReachable:
            net=NO;
            break;
        case ReachableViaWiFi:
            net=YES;
            break;
        case ReachableViaWWAN:
            net=YES;
            break;
    }

    if (net)
    {
        HUD.labelText=@"Connecting.,,";
        HUD.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@""]];
        HUD.mode = MBProgressHUDModeCustomView;
        [HUD hide:YES afterDelay:2];
        return;
    }
    else
    {
        UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"Alert.!" message:@"Check Your Network Connection.!" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [alert show];
    }
}

1 个答案:

答案 0 :(得分:1)

选择目标转到构建阶段选择编译源单击+并选择reachability.m您已排序