Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/107.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios XML-RPC请求Wordpress_Ios_Wordpress_Xml Rpc - Fatal编程技术网

Ios XML-RPC请求Wordpress

Ios XML-RPC请求Wordpress,ios,wordpress,xml-rpc,Ios,Wordpress,Xml Rpc,从xmlrpc服务器响应对象中获取术语中的名称(我博客文章类别的名称)的值没有问题 服务器响应: responseArray: ( { guid = "http://www.domain.com/wp/?p=12"; "post_id" = "123"; terms = ( { name = "Uncategorized"; } ); } ) 。。。使用以下几行Objective-C代码: NSMutableArray

从xmlrpc服务器响应对象中获取
术语中的
名称
(我博客文章类别的名称)的值没有问题

服务器响应:

responseArray: ( 
    { guid = "http://www.domain.com/wp/?p=12";
      "post_id" = "123";
      terms = (
          { name = "Uncategorized"; }
      );
    }

)
。。。使用以下几行Objective-C代码:

NSMutableArray *responseArray = [[NSMutableArray alloc] init];
responseArray = [nodeSaveResponse object];

for(i = 0; i < responseArray.count; i++) {

    NSString *postLink = [[responseArray objectAtIndex: i] valueForKey: @"guid"];
    NSString *postId = [[responseArray objectAtIndex: i] valueForKey: @"post_id"];

    NSMutableArray *catArray = [[NSMutableArray alloc] init];
    catArray = [[responseArray objectAtIndex: i] valueForKey: @"terms"]];
    NSArray *cat = [catArray valueForKey: @"name"];
    NSString *myCatString = [cat objectAtIndex: 0];
}
知道我的错在哪里吗

干杯,马丁

NSString *myCatString = @"MyCategory";
NSMutableDictionary *name = [[NSMutableDictionary dictionaryWithObjectsAndKeys: myCatString, @"name", nil];
NSMutableArray *catArray = [[NSMutableArray arrayWithObject: name];

NSMutableDictionary *values = [[NSMutableDictionary alloc] init];
[values setObject: title forKey: @"post_title"]; 
// and so on with other values - until here everything works well
[values setObject: catArray forKey: @"terms"]; // if this line is called, the request fails

NSArray *params = [NSArray arrayWithObjects: @"1", user, pass, values, nil];
[myRequest setMethod: @"wp.newPost" withParameter: params];