mockCastGeneratedMessage

mockCastGeneratedMessage

While waiting for a fix, a temporary solution might be to mock GCKPB_PBGeneratedMessage's +initialize method in your unit tests with OCMock (or any other mocking framework) by adding the following code to your test class:#import <OCMock/OCMock.h>@interface GCKPB_PBGeneratedMessage : NSObject@end和+ (void)initialize{ id mockCastGeneratedMessage = [OCMockObject mockForClass:[GCKPB_PBGeneratedMessage class]]; [[mockCastGeneratedMessage stub] initialize];} 修改自iOS发送器API v2.3.0 953起,此问题已修复,不再需要此解决方法.As of iOS sender API v2.3.0 953, this is now fixed and this workaround is no longer required. 这篇关于单元测试时找不到枚举描述符PBFieldDescriptorProto_Label的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-04 22:49