How to pass parameters to DIOSNode nodeWithIndex #97

murphlab opened this Issue Aug 28, 2013 · 4 comments

4 participants


I'm using drupal-ios-sdki 2.0.3 and Drupal 7.2.2

I'm trying to pass parameters to [DIOSNode nodeIndexWithPage...] in order to limit the response to nodes of a specific type. Per the Drupal documentation, the URL should look something like this:


I've tried a number of permutations, such as:

[DIOSNode nodeIndexWithPage:@"0"
                 parameters:[NSArray arrayWithObjects:@"type", @"cabinet_item", nil]
                    success:^(AFHTTPRequestOperation *operation, id responseObject)
                    failure:^(AFHTTPRequestOperation *operation, NSError *error)

This however formats parameters like so:


... which is not what Drupal expects. Is there a way to accomplish this?


I got this to work (finally) by changing the "parameters:" parameter to NSDictionary, and passing in a NSDictionary object with my keys and parameters instead of an NSArray.

For example:

NSDictionary *parameters = [[NSDictionary alloc]initWithObjectsAndKeys:@"1", @"status", @"page", @"type", nil];

[DIOSNode nodeIndexWithPage:@"0" fields:@"nid, title, type, status" parameters:parameters pageSize:@"100" success:^(AFHTTPRequestOperation *operation, id responseObject) {
    NSLog(@"Response object: %@", [responseObject description]);
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    NSLog(@"Error: %@", [error description]);

You have to change DIOSNode as well to accept NSDictionary instead of NSArray.


Hi I realise drupal-ios-sdki 2.0.6 DIOSnode nodeIndexWithPage is still asking for NSArray instead of NSDictionary.

As @spartansystems had mentioned, changing the datatype to NSDictionary works well. Not sure if this is a bug or we are passing in wrong values to the NSArray.

Hope @kylebrowning could look into it. Thanks.


Ill have an update for 2.0.7 in a little bit


2.0.7 is out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment