Forums

key for fetching response data

  1. Hi everyone,

    I'm using parts of the Wordpress app to enable XML-RPC calls within my own app. I wrote a simple application to see how it all works. I am able to send a request and get a response, but I don't understand how to fetch data from the response. My response in XML looks like this:

    <methodResponse>
     <params>
       <param>
          <value>
            <boolean>0</boolean>
          </value>
        </param>
      </params>
    </methodResponse>

    according to , you can use keys to fetch the data in the response - but what is the key's name?

    id result = [self executeXMLRPCRequest:request byHandlingError:TRUE]
    label.text = [response valueForKey:???]

    Thanks,

    Lex`

  2. Lex,

    While I can't go into great detail on this iPhone app support blog I think your difficulty could be solved by making result an array instead of an id.

    You could then output the array to the log, (without any nasty casts) allowing you to discover what, specifically is being returned. The keys will be completely dependent on what is being returned by the XMLRPC server you are pinging.

    May I suggest:

    NSArray *result = [self executeXMLRPCRequest:request byHandlingError:TRUE];
    NSLog(@"result Array: %@", result);

    Hope that helps...

Topic Closed

This topic has been closed to new replies.


About this Topic