0
如何通过json post发送NSObject类?通过json post发送课程
例子:
@interface TestClass : NSObject
@property (nonatomic,strong) NSString *Value1;
@property (nonatomic,strong) NSString *Value2;
@property (nonatomic,strong) NSString *Value1;
@end
在实现TestClass的另一个文件:
TestClass *test = [[TestClass alloc]init];
test.Value1 = @"First";
test.Value2 = @"Second";
test.Value3 = @"Third";
.....
如何测试对象发送?
只是为了记录 - 它不是你试图序列化的类,而是类的_instance_。幸运的是,这简单得多。此外,正常的命名约定将具有以小写字母开头的属性(和方法)名称。 – Monolo
在http://stackoverflow.com/a/20996601/730807中看到我的答案我正在使用这种方式,它工作得很好,它也会满足您的需求。希望这有助于您。 –