PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, May 16, 2022

[FIXED] How to get the display_name from the XML-RPC response in Objective C

 May 16, 2022     ios, iphone, objective-c, wordpress, xml-rpc     No comments   

Issue

In my iPhone app I am accessing a WordPress powered blog using XML-RPC WordPress APIs, and I am fetching the userlists through a XML-RPC method wp.getUsers connection. This is all working fine and I got the response as below (NSLog output):

2012-07-24 11:13:19.317 projectABC[1465:207] (
        {
        "display_name" = "Ravi Interior Design";
        email = "info@xyz.com";
        nicename = abiqsd;
        registered = "2012-05-11 11:58:52 +0000";
        "user_id" = 15;
        username = abssid;
    },
        {
        "display_name" = "qqHeuer";
        email = "aheuer@xyz.com";
        nicename = adamhequer;
        registered = "2012-05-18 15:59:30 +0000";
        "user_id" = 44;
        username = adamhequer;
    },
        {
        "display_name" = "Asdasm Rseyses";
        email = "xyz@abc.net";
        nicename = adaqmraeyes;
        registered = "2012-06-02 18:51:06 +0000";
        "user_id" = 160;
        username = adaqmreyeqs;
    },

Now I need to store only display_name in an NSArray, but I am not getting how to extract only display_name from the above XML-RPC response. How can I achieve this?


Solution

Assuming what you printing is NSArray of Dictionaries,

NSLog(@"%@",[yourArray valueForKeyPath:@"display_name"])


Answered By - Vignesh
Answer Checked By - Marilyn (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing