自Xcode 5.1问世以来的最后几天,我没有运气.
我一直在支持iOS 6.0的旧项目上遇到此错误:
ERROR:
clang: error: unknown argument: '-fno-obj-arc' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
Run Code Online (Sandbox Code Playgroud)
在互联网上关于这一点的帖子不多,一些建议似乎是要改变你的,CFLAGS但我不知道如何在Xcode中做到这一点.
Apple从他们的文件中建议:
编译器
从Apple LLVM编译器版本5.1(clang-502)及更高版本开始,优化级别-O4不再意味着链接时间优化(LTO).为了使用LTO进行构建,除了优化级别标志外,还要使用-flto选项.(15633276)Xcode 5.1中的Apple LLVM编译器将无法识别的命令行选项视为错误.在构建Python本机扩展和Ruby Gems时已经看到了这个问题,其中当前指定了一些无效的编译器选项.需要更改使用无效编译器选项的项目以删除这些选项.为了帮助简化转换,编译器将暂时接受将错误降级为警告的选项:
-Wno-error=unused-command-line-argument-hard-error-in-future注意:将来不支持此选项.要解决此问题,请将ARCHFLAGS环境变量设置为将错误降级为警告.例如,您可以使用以下命令安装Python原生扩展:
$ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future easy_install ExtensionName同样,您可以安装Ruby Gem:
$ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install GemName 16214764 updated
我如何获得此解决方法?显然苹果已经搞砸了,因为它只应该根据他们的文件向我发出警告而不是错误.
任何帮助将不胜感激.在此问题得到解决之前,我无法构建我的应用程序.
当我运行Xcode 6并使用iOS 8模拟器时,我正在尝试加载MFMailComposeViewController,它没有出现.相反,我得到这个错误......
"警告:尝试在ViewController上显示MFMailComposeViewController:0x7c30c400:0x7baf6000已经呈现(null)"
这个完全相同的代码已经工作了将近一年,没有变化.可以肯定的是,我使用iOS 7.1模拟器在Xcode 6中运行我的应用程序,它完全像以前一样工作.
有谁知道如何在iOS 8中显示MFMailComposeViewController视图?这似乎是一个简单的任务,我确信这是一个简单的解决方案.
PS.不需要发布,因为它是标准代码,但无论如何......
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
//Current Date
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
NSDate *date = [NSDate date];
//Ensure UTC DATE
[formatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
[formatter setDateFormat:@"MM/dd/yyyy 'at' HH:mm:ss UTC"];
NSString *myString = [formatter stringFromDate:date];
NSString *emailBody = [NSString stringWithFormat:@"Feedback time at %@.<br><br>Name:", myString];
[picker setMessageBody:emailBody isHTML:YES];
NSString *subject, *emailAddress;
[formatter setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];
[formatter setDateFormat:@"MM/dd/yyyy"];
subject = [NSString stringWithFormat:@"Feedback"];
//Set the Subject
[picker setSubject:subject];
emailAddress = @"xxx@example.com"; …Run Code Online (Sandbox Code Playgroud)