简体   繁体   English

如何使用情节提要创建自定义可可触摸框架

[英]How to create custom cocoa touch framework with storyboard

I'm following this tutorial to create a custom framework. 我正在按照本教程创建自定义框架。 I have tried the source code as in that tutorial, excepts that when building the framework, I just select "Build Only Device>Generic iOS Device" and press Command+B, instead of using the build scripts introduced in that tutorial. 我尝试了该教程中的源代码,除了在构建框架时,我只是选择“仅构建设备>通用iOS设备”,然后按Command + B,而不使用该教程中介绍的构建脚本。 It works fine for me with the source code copied from that tutorial. 从该教程复制的源代码对我来说效果很好。

After that, I tried to build my own framework with storyboard and build it like above, then try using it in a simple test app. 之后,我尝试使用情节提要构建自己的框架,并像上面那样构建它,然后尝试在一个简单的测试应用程序中使用它。 The framework built successful but when I include it in the test app, it doesn't work. 该框架构建成功,但是当我将其包含在测试应用程序中时,它将无法正常工作。 The error message is: 错误消息是:

在此处输入图片说明

I am using the latest version of xcode and mac osx. 我正在使用最新版本的xcode和mac osx。 My entire source code for both test application and simple framework is in this link . 我的整个测试应用程序和简单框架的源代码都在此链接中 Please take a look and help me find what is going wrong. 请看看并帮助我找出问题所在。 Thanks so much! 非常感谢!


Solved 解决了

I just find out why. 我只是找出原因。 It seems like that is because I have opened both Test Application and the framework project in two workspaces. 好像是因为我在两个工作区中同时打开了Test Application和Framework项目。 Closing the framework project before import it to the Test Application solve the problem. 在将框架项目导入到测试应用程序之前,先将其关闭即可解决该问题。

Can you check target membership at right pane for this class? 您可以在右侧窗格中检查此类的目标成员资格吗? Check all boxes if it is empty. 选中所有框是否为空。

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

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