「ios開発」json文字列をアペンドする
サンプルコード:
-(NSString *) getJsonString
{
NSMutableString *json = [NSMutableString stringWithCapacity:128];
NSString *jsonString=nil;
SBJsonWriter *writer = [[SBJsonWriter alloc] init];
[json appendString:@"{\"data\":{“];
[json appendFormat:@"\"%@\":\"%d\",",@"reset",reset];
if(missionStatus!=NULL)
{
jsonString=[writer stringWithObject:status];
if(jsonString!=NULL)
{
[json appendString:@"\"status\":"];
[json appendString:jsonString];
}
}
[json appendString:@"}}"];
return json;
}