如何在iOS的今日小部件中包含主要应用程序的类? [英] How to include classes of main application in to today widgets in iOS?

查看:82
本文介绍了如何在iOS的今日小部件中包含主要应用程序的类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在主应用程序中获得了 Class1.h .而且我必须在iOS的Today窗口小部件中使用Class1.h.在iOS的主应用和小部件之间共享类的方法是什么?

I have got Class1.h in the main Application. And I have to use Class1.h in the Today Widget in iOS. What is the method to share the classes among the main app and widget in iOS ?

推荐答案

在Xcode中,在项目浏览器"中找到Class1.m.选择它,然后在文件检查器"中,选中目标成员身份"下今日"窗口小部件目标旁边的框.

In Xcode, find Class1.m in the Project Navigator. Select it and, in the File Inspector, check the box next to your Today widget target under Target Membership.

然后,您应该可以在今日"窗口小部件代码中导入Class1.h.

Then you should be able to import Class1.h in your Today widget code.

这篇关于如何在iOS的今日小部件中包含主要应用程序的类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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