如何测试Objective-c对象的类型?与对象类似的东西吗? [英] How to test the type of an Objective-c Object ? something similar to is with Object?

查看:49
本文介绍了如何测试Objective-c对象的类型?与对象类似的东西吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何测试 Objective-c对象的类型?与Tobject的 is 类似吗?要进行投射,我们有 wrap ,但是我找不到如何测试

How to test the type of an Objective-c Object ? something similar to is with TObject? To cast we have wrap but I don't find how to test

推荐答案

我记得我实际上在自己的代码中使用object_getClass:-)

I remembered that I'm actually using object_getClass in my own code :-)

这是来自 DW的示例.Notifications.iOS.pas :

if request.trigger.isKindOfClass(objc_getClass('UNPushNotificationTrigger')) then

这篇关于如何测试Objective-c对象的类型?与对象类似的东西吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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