在Xcode中将Mac目标添加到iOS项目中,现在“启动可执行文件出错" [英] Added Mac target to iOS project in Xcode, now 'Error Starting Executable File'

查看:147
本文介绍了在Xcode中将Mac目标添加到iOS项目中,现在“启动可执行文件出错"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已决定在iOS应用程序中建立一个Mac OSX端口,因此,根据收到的许多建议,我只是向iOS项目中添加了一个新的Cocoa目标,并设置了一系列我已经添加到OSX目标中的库(封装了应用程序的核心业务逻辑).我还没有将所有UIViewController代码添加到OSX目标-出于明显的原因,我将不得不重写UI代码.该应用程序运行良好(没有缺少库的编译器错误,等等),但是由于某种原因,当我尝试运行"hello world"程序时,收到以下错误消息,我想在开始之前就开始工作认真编码.这是消息:

I've decided to make a Mac OSX port of my iOS app, so based on a number of suggestions I've received I've simply added a new Cocoa target to my iOS project, and set up a series of 'libraries' (which encapsulate the core business logic of my app) which I have added to the OSX target. I have not added all of the UIViewController code to the OSX target - I will have to rewrite the UI code, for obvious reasons. The app is building fine (no compiler errors for missing libraries, etc.), but for some reason I get the following error message when I try to run the 'hello world' program, which I'd like to get working before I start coding in earnest. Here's the message:

Error Starting Executable 'MyExecutableMac'

No executable file found.
Use "file" or "exec-file" command.

根据这个问题,我确保正确的可执行文件是列在方案构建设置下,以便它可以实际运行.但是,实际上似乎.app文件未正确打包-该.app文件在文件列表中仍被列为红色",表示该文件丢失.可能是什么原因导致此错误?

As per this SO question, I made sure that the proper executable file was listed under the scheme build settings, so that it will actually run. However it actually appears that the .app file is not being packaged properly - the .app file is stil listed as "red" in the file list, meaning the file is missing. What might be causing this error?

推荐答案

我在Xcode 4.2中遇到了此问题,我发现首先进行清理(Xcode>产品>清理,然后选择单击产品>清理生成文件夹…)可以解决此问题.

I had this problem in Xcode 4.2, I found that first doing a clean (Xcode > Product > Clean and option clicking Product > Clean Build Folder…) fixed it.

这篇关于在Xcode中将Mac目标添加到iOS项目中,现在“启动可执行文件出错"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆