+ Start a Discussion
ClintLeeClintLee 

SFResetDelegate Not Receiving Callbacks

Hi guys,

 

I am using the mobile sdk in an existing project ( not using the template ).  To preface, this project is in xcode 4.3.3, targeting ios 5 and using storyboards. 

 

I've created a class which conforms to SFOAuthCoordinatorDelegate that is handling and displaying the OAuth dance.  This seems to all be working just fine and I can see that I'm being authenticated. 

 

However, this is where two strange things are happening.  First, in the oauthDidAuthenticate method I try to assign the coordinator to the SFRestAPI shared instance and I am getting an NSInvalidArgument exception that's referencing something to do with NSURL and queryParameters.  I believe it has something to do with the instanceUrl property on the coordinator's credentials, so I'm setting the instanceUrl to nil and then assigning the coordinator to the shared instance of SFRestAPI.

 

Next, I have a method that gets notified when the authentication has been successfully completed.  This method is in a class that conforms to SFRestDelegate.  Here I reset the instanceUrl property of the shared instance back to what it should be.  Then, I try to send a simple query for Contacts.  I can see in the logs that the request is being created with the proper endpoint, method, path, and queryParams, but none of the SFRestDelegate methods are getting any info back.  The flow just ends.

 

Has anyone else come across this and/or have any ideas?

 

Thanks as always,

 

Clint

 

mobillemobille

Hi,

 

have tried inthios way??

 NSString *query = @"Select Id,Name,Birthdate from Contact";
  SFRestRequest *request = [[SFRestAPI sharedInstance] requestForQuery:query];
    [[SFRestAPI sharedInstance] send:request delegate:self];

 

 

import delegate<SFRestDelegate>

 

implement these methods

 

- (void)request:(SFRestRequest *)request didLoadResponse:(id)jsonResponse;

/**
 * Sent when a request has failed due to an error.
 * This includes HTTP network errors, as well as Salesforce errors
 * (for example, passing an invalid SOQL string when doing a query).
 */
- (void)request:(SFRestRequest *)request didFailLoadWithError:(NSError*)error;

/**
 * Sent to the delegate when a request was cancelled.
 */
- (void)requestDidCancelLoad:(SFRestRequest *)request;