简体   繁体   English

XCode 7:链接器命令失败,退出代码为1(使用-v查看调用)

[英]XCode 7 : linker command failed with exit code 1 (use -v to see invocation)

在此处输入图片说明

Ld /Users/Abhinav/Library/Developer/Xcode/DerivedData/UsingSegue-bujjpyciairreubqxbgfqixpwbiv/Build/Products/Debug-iphonesimulator/UsingSegue.app/UsingSegue normal i386
    cd "/Users/Abhinav/Desktop/Fist Project/UsingSegue"
    export IPHONEOS_DEPLOYMENT_TARGET=9.2
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk
-L/Users/Abhinav/Library/Developer/Xcode/DerivedData/UsingSegue-bujjpyciairreubqxbgfqixpwbiv/Build/Products/Debug-iphonesimulator
-F/Users/Abhinav/Library/Developer/Xcode/DerivedData/UsingSegue-bujjpyciairreubqxbgfqixpwbiv/Build/Products/Debug-iphonesimulator
-filelist /Users/Abhinav/Library/Developer/Xcode/DerivedData/UsingSegue-bujjpyciairreubqxbgfqixpwbiv/Build/Intermediates/UsingSegue.build/Debug-iphonesimulator/UsingSegue.build/Objects-normal/i386/UsingSegue.LinkFileList
-Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=9.2 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -dependency_info -Xlinker /Users/Abhinav/Library/Developer/Xcode/DerivedData/UsingSegue-bujjpyciairreubqxbgfqixpwbiv/Build/Intermediates/UsingSegue.build/Debug-iphonesimulator/UsingSegue.build/Objects-normal/i386/UsingSegue_dependency_info.dat
-o /Users/Abhinav/Library/Developer/Xcode/DerivedData/UsingSegue-bujjpyciairreubqxbgfqixpwbiv/Build/Products/Debug-iphonesimulator/UsingSegue.app/UsingSegue

duplicate symbol _OBJC_IVAR_$_NextViewController._NextArray in:
    /Users/Abhinav/Library/Developer/Xcode/DerivedData/UsingSegue-bujjpyciairreubqxbgfqixpwbiv/Build/Intermediates/UsingSegue.build/Debug-iphonesimulator/UsingSegue.build/Objects-normal/i386/ViewController.o
    /Users/Abhinav/Library/Developer/Xcode/DerivedData/UsingSegue-bujjpyciairreubqxbgfqixpwbiv/Build/Intermediates/UsingSegue.build/Debug-iphonesimulator/UsingSegue.build/Objects-normal/i386/NextViewController.o duplicate symbol _OBJC_CLASS_$_NextViewController in:
    /Users/Abhinav/Library/Developer/Xcode/DerivedData/UsingSegue-bujjpyciairreubqxbgfqixpwbiv/Build/Intermediates/UsingSegue.build/Debug-iphonesimulator/UsingSegue.build/Objects-normal/i386/ViewController.o
    /Users/Abhinav/Library/Developer/Xcode/DerivedData/UsingSegue-bujjpyciairreubqxbgfqixpwbiv/Build/Intermediates/UsingSegue.build/Debug-iphonesimulator/UsingSegue.build/Objects-normal/i386/NextViewController.o duplicate symbol _OBJC_METACLASS_$_NextViewController in:
    /Users/Abhinav/Library/Developer/Xcode/DerivedData/UsingSegue-bujjpyciairreubqxbgfqixpwbiv/Build/Intermediates/UsingSegue.build/Debug-iphonesimulator/UsingSegue.build/Objects-normal/i386/ViewController.o
    /Users/Abhinav/Library/Developer/Xcode/DerivedData/UsingSegue-bujjpyciairreubqxbgfqixpwbiv/Build/Intermediates/UsingSegue.build/Debug-iphonesimulator/UsingSegue.build/Objects-normal/i386/NextViewController.o ld: 3 duplicate symbols for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I have checked my Compile Sources, there are no duplicates there , still I am getting this error. 我检查了我的“编译源”,那里没有重复的内容,但仍然出现此错误。 I am new to IOS , someone please help. 我是IOS的新手,请帮助。 I am trying to create array in a View Controller and then pass it to another view controller using segues. 我试图在视图控制器中创建数组,然后使用segues将其传递给另一个视图控制器。

ViewController.m : ViewController.m:

-(IBAction)click:(id)sender
    {
    self.ArrayInput = [[NSMutableArray alloc]init];
    [self.ArrayInput addObject:@[_firstname.text]];
    [self.ArrayInput addObject:@[_lastname.text]];
    [self.ArrayInput addObject:@[_Email.text]];

NextViewController * nextcontroller = (NextViewController *)[self.storyboard     instantiateViewControllerWithIdentifier:@"NextViewController"];
[self.navigationController pushViewController:nextcontroller animated:YES];

}

Then using segue in ViewController.m: 然后在ViewController.m中使用segue:

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
NextViewController * NextVC = (NextViewController *)segue.destinationViewController;
NextVC.NextArray = [NSMutableArray arrayWithArray:self.ArrayInput];

}

NextViewController.m: NextViewController.m:

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:    (NSIndexPath *)indexPath
    {
        myTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"myTableViewCell" forIndexPath:indexPath];
        cell.Data.text = [self.NextArray objectAtIndex:indexPath.row];

    return cell;

}

this error often happens is accidentally importing the .m file instead of the .h 经常发生此错误是意外导入.m文件而不是.h文件

OR 要么

Steps: 脚步:

  1. Check Build phases in Target settings. 在目标设置中检查构建阶段。
  2. Check if any file exists twice or once. 检查文件是否存在两次或一次。
  3. If file exist twice delete one. 如果文件存在两次,则删除一个。

再次检查了我的代码..在NextViewController.m中声明了nsmutablearray ...在NextViewController.h中创建了数组,并在ViewController.m中包含了NextViewController.h文件..解决了我的问题..谢谢。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 xCode 7:链接器命令失败,退出代码为1(使用-v查看调用) - xCode 7: linker command failed with exit code 1 (use -v to see invocation) Xcode 8:链接器命令失败,退出代码为1(使用-v查看调用) - Xcode 8: linker command failed with exit code 1 (use -v to see invocation) 链接器命令失败,退出代码为1(使用-v查看调用)-Xcode - linker command failed with exit code 1 (use -v to see invocation) - Xcode Xcode链接器命令失败,退出代码为1(使用-v查看调用) - Xcode linker command failed with exit code 1 (use -v to see invocation) xCode中的“链接器命令失败,退出代码为1(使用-v查看调用)” - “Linker command failed with exit code 1 (use -v to see invocation)” in xCode linker 命令失败,退出代码为 1(使用 -v 来查看调用) Xcode - linker command failed with exit code 1 (use -vto see invocation) Xcode 链接器命令失败,退出代码为1(使用-v查看调用 - linker command failed with exit code 1 (use -v to see invocation 链接器命令失败,退出代码为1(使用-v查看调用)错误? - linker command failed with exit code 1 (use -v to see invocation) error? 链接器命令失败,退出代码为1(使用-v查看调用) - Linker command failed with exit code 1(use -v to see invocation) 链接器命令失败,迅速退出代码为1(使用-v查看调用) - linker command failed with exit code 1 (use -v to see invocation) in swift
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM