2014-10-30 17 views
0

JSONMODEL iOS的錯誤JSONValueTransformer JSONObjectFrom沒有發現

@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文件一個相當簡單的JSONModel.h文件

@implementation MyModel @end 
@implementation MyInnerModel @end 

然後我得到一些JSON在HTTP請求並做

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 

我怎樣才能修復它與單元測試運行?

回答