Iphone 如何在Objective C中使用JSON发布NSArray
我正在开发一个应用程序。我想将NSArray发布到webservice,将数组数据保存在db中 我现在正在iphone应用程序中使用JSON API 我寻求有关如何发布NSArray的帮助,因为我找不到任何发布阵列数据的方法 提前谢谢。这里我用的是sbjonIphone 如何在Objective C中使用JSON发布NSArray,iphone,objective-c,Iphone,Objective C,我正在开发一个应用程序。我想将NSArray发布到webservice,将数组数据保存在db中 我现在正在iphone应用程序中使用JSON API 我寻求有关如何发布NSArray的帮助,因为我找不到任何发布阵列数据的方法 提前谢谢。这里我用的是sbjon #import "SBJSON.h" #import "JSON.h" SBJSON *jparser = [[SBJSON new] autorelease]; NSString *jsonItems = [
#import "SBJSON.h"
#import "JSON.h"
SBJSON *jparser = [[SBJSON new] autorelease];
NSString *jsonItems = [jparser stringWithObject:self.urArray];
NSString *userlogin_id=@"AppleVijay";
NSString *venue_id=@"India";
NSString *postString =[NSString stringWithFormat:@"userlogin_id=%@&venue_id=%@&items=%@",userlogin_id,venue_id,jsonItems];
NSURL *urURL=[NSURL URLWithString:@"AppleVijay@facebook.com"];
NSMutableURLRequest *request=[NSMutableURLRequest requestWithURL:urURL];
[request setHTTPMethod:@"POST"];
[request setHTTPBody:[postString dataUsingEncoding:NSUTF8StringEncoding]];
NSURLConnection *connection=[[NSURLConnection alloc]
initWithRequest:request delegate:self];
非常感谢,我现在正在尝试并将检查它。