简体   繁体   English

将框架导入现有项目

[英]Importing framework into existing project

I'm trying to import Parse.com's framework into an existing project, but for some reason I can't access all the header files included in the framework. 我试图将Parse.com的框架导入到现有项目中,但是由于某些原因,我无法访问该框架中包含的所有头文件。 When I create a new project, I can access all the framework's objects, methods, and header files just fine. 创建新项目时,可以很好地访问框架的所有对象,方法和头文件。 And if I add it to another existing project that I haven't done played around with too much, it also works fine. 而且,如果我将它添加到另一个我没有做太多工作的现有项目中,那么它也可以正常工作。

What could I have done to my existing project to make it not import a framework correctly/not let me use all the headers? 我应该如何处理现有项目,以使其无法正确导入框架/不让我使用所有标头?

I've been working on this project for a while and have added a number of other frameworks (MKStoreKit, SDWebImage) and messed with the app's settings, so I have no idea where to start with trying to track this issue down. 我已经在这个项目上工作了一段时间,并添加了许多其他框架(MKStoreKit,SDWebImage)并弄乱了应用程序的设置,所以我不知道从哪里开始着手解决这个问题。

Thanks! 谢谢!

Edit 编辑

When I copy the folder to Dropbox, the framework works fully from that file as well... What could be going on here? 当我将文件夹复制到Dropbox时,该框架也可以从该文件完全正常工作……这里可能发生什么情况? What doesn't get carried over when you copy a project from one location to another? 当您将项目从一个位置复制到另一个位置时,什么不会保留下来?

For the headers to be available the framework has to be built to expose the public headers. 为了使标题可用,必须构建框架以公开公共标题。 If you are building the framework yourself make sure you check build phases and specify the public headers 如果您自己构建框架,请确保检查构建阶段并指定公共头文件

odd problem. 奇怪的问题。 here is a back to basics suggestion. 这是回到基本建议。 sorry if its seems obvious. 很抱歉,如果它似乎很明显。

I would suggest to remove the framework from the project, then go to finder and make sure that there is no residual files or directories in the project folders. 我建议从项目中删除框架,然后转到finder并确保项目文件夹中没有残留文件或目录。

Also, if you are using git, make sure there is no reference to exclude the files from your project directory in .gitignore 另外,如果您使用的是git,请确保没有引用从.gitignore中的项目目录中排除文件

do a clean - shift, cmd K 清洁-移位,cmd K

Then go to the project info tab, then frameworks, then hit the + key to add a new framework, then choose other, then pick your parse framework. 然后转到项目信息选项卡,然后转到框架,然后按+键添加新框架,然后选择其他,然后选择解析框架。

that should work. 那应该工作。

if not, do all that, then close and restart Xcode, then reopen your project and try again. 如果不是,请执行所有操作,然后关闭并重新启动Xcode,然后重新打开您的项目,然后重试。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM