iPhone API:向第三方应用程序委托添加方法
我们正在使用第三方库,它带有自己的应用程序委托类。
在应用程序的主文件中,其启动
UIApplication 对象如下:
retVal = UIApplicationMain(argc, argv, nil, @"3ThParty1AppDelegate");
现在,我没有应用程序委托类的任何源代码,但我需要添加用于后台处理和推送通知的方法。是否可以添加它?
非常感谢,
冈特尔
we are using a third 3 party library which comes with its own application delegate class.
In the main file of the of the application its initiating the
UIApplication object as follows :
retVal = UIApplicationMain(argc, argv, nil, @"3ThParty1AppDelegate");
Now, I don't have any source code of the app delegate class but I need to add methods for background processing and push notifications. Would it be possible at all to add it ?
thanks so much,
Guenter
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最明显的方法是创建一个包含附加方法的类别。但是,如果您还需要添加属性,这并不能解决问题。在这种情况下,您需要扩展应用程序委托类。实际上,就在这一分钟,我已经使用 GH Unit 的单元测试驱动程序执行了相同的操作,以向其应用程序委托添加其他方法,并且其使用方式完全相同。
The obvious way is to create a category that contains the additional methods. However that won't cut it if you need to add properties as well. In that case you need to extend the app delegate class. I've literally just this minute done the same things with the unit test driver for GH Unit to add additional methods to it's app delegate and it's used exactly the same way.