目标C& OC Mock-模拟类方法? [英] Objective C & OC Mock - Mocking a class method?

查看:78
本文介绍了目标C& OC Mock-模拟类方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要能够确定是否调用了类方法. 我该如何使用OCMock?

I need to be able to determine whether a class method was called or not. How can I do this with OCMock?

推荐答案

从OCMock 2.1版开始,此功能即刻受支持.现在,您可以以与存根实例方法相同的方式存根类方法.

Starting with OCMock release 2.1 this is supported out of the box. You can now stub class methods in the same way as you stub instance methods.

这篇关于目标C& OC Mock-模拟类方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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