我在文件中有一个相当简单的JSONModel
类.h
@class MyInnerModel;
@protocol MyModel <NSObject> @end
@interface MyModel:JSONModel
@property(nonatomic,assign)NSInteger _id;
@property(nonatomic,strong)NSString *type;
@property(nonatomic,strong)MyInnerModel *innerModel;
@end
@protocol MyInnerModel <NSObject> @end
@interface MyInnerModel :JSONModel
@property (nonatomic,strong)NSString *stam;
@end
在.m
文件中
@implementation MyModel @end
@implementation MyInnerModel @end
然后我在http请求中得到一些json并做
JSONModelError *error = nil;
MyModel *output = [[MyModel alloc] initWithString:json error:&error];
if(error){
LogInfo(@"Error creating output,%@",[error description]);
return nil;
}
这在正常运行时完美运行。
但是当我尝试在单元测试期间运行它时,我得到以下信息:
2014-10-30 10:41:49.805 MyApp[61195:489073] [JSONModel.m:990] EXCEPTION: [JSONValueTransformer __JSONObjectFromMyInnerModel:] not found
我怎样才能修复它以运行单元测试?