Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8564171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:08:07+00:00 2026-06-11T17:08:07+00:00

I’m having a horrible time getting this thing to work at all. I’ve spent

  • 0

I’m having a horrible time getting this thing to work at all. I’ve spent two days reading the documentation on Salesforce’s website, the example code in the distributed SDK and just generally beating my head against the wall.

The most frustrating part is that I think I’m just missing the login screen, but I can’t find anything that will tell me how to make one. From what I can tell, it’s just a UIWebView that points to the SF login page.

Here’s what I’ve been able to figure out so far:

  1. Added the SDK to my project (SalesforceSDK, SalesforceOAuth, RestKit) and linked against all the libraries that are mentioned in the Git readme.
  2. Included "SFRestAPI.h" in my server communications class I’m using to send and receive data from the server.
  3. Called the SFRestRequest using the code from the XCode template that’s distributed with the SDK:

    SFRestRequest *request = [[SFRestAPI sharedInstance] requestForQuery:@"SELECT Name FROM User LIMIT 10"];
    [[SFRestAPI sharedInstance] send:request delegate:self];
    
  4. Added the delegate methods:


#pragma mark - Salesforce REST API delegate methods

- (void)request:(SFRestRequest *)request didLoadResponse:(id)jsonResponse
{
    NSLog(@"%@", jsonResponse);
}

- (void)request:(SFRestRequest *)request didFailLoadWithError:(NSError*)error
{
    NSLog(@"%@", error);
}

- (void)requestDidCancelLoad:(SFRestRequest *)request
{
    NSLog(@"%@", request);
}

- (void)requestDidTimeout:(SFRestRequest *)request
{
    NSLog(@"%@", request);
}


5. Saw this in the console:

`2012-09-11 10:23:44.128 ClientApp[39697:c07] SFRestAPI::send: <SFRestRequest 0xd4a9cb0 
endpoint: /services/data 
method: GET 
path: /v23.0/query 
queryParams: {
  "q" : "SELECT Name FROM User LIMIT 10"
}`

None of the delegate methods for SFRestRequest were called.

Here’s what hasn’t worked:

Making my app delegate a subclass of SFNativeRestAppDelegate

This created about 12 duplicate symbol errors:

duplicate symbol _OBJC_CLASS_$_SFNativeRestAppDelegate in:
    /Volumes/Wallace/Users/gromitt/Library/Developer/Xcode/DerivedData/ClientApp-bpccblcllzkzvudxtwutuqliagld/Build/Intermediates/ClientApp.build/Debug-iphonesimulator/ClientApp.build/Objects-normal/i386/SFNativeRestAppDelegate.o
    /Volumes/Wallace/Users/gromitt/Documents/Out to Lunch/ iOS Apps/ClientApp/ClientApp/dependencies/SalesforceSDK/libSalesforceSDK.a(SFNativeRestAppDelegate.o)
duplicate symbol _OBJC_IVAR_$_SFNativeRestAppDelegate._authViewController in:
    /Volumes/Wallace/Users/gromitt/Library/Developer/Xcode/DerivedData/ClientApp-bpccblcllzkzvudxtwutuqliagld/Build/Intermediates/ClientApp.build/Debug-iphonesimulator/ClientApp.build/Objects-normal/i386/SFNativeRestAppDelegate.o
    /Volumes/Wallace/Users/gromitt/Documents/Out to Lunch/ iOS Apps/ClientApp/ClientApp/dependencies/SalesforceSDK/libSalesforceSDK.a(SFNativeRestAppDelegate.o)
duplicate symbol _OBJC_IVAR_$_SFNativeRestAppDelegate._viewController in:
    /Volumes/Wallace/Users/gromitt/Library/Developer/Xcode/DerivedData/ClientApp-bpccblcllzkzvudxtwutuqliagld/Build/Intermediates/ClientApp.build/Debug-iphonesimulator/ClientApp.build/Objects-normal/i386/SFNativeRestAppDelegate.o
    /Volumes/Wallace/Users/gromitt/Documents/Out to Lunch/ iOS Apps/ClientApp/ClientApp/dependencies/SalesforceSDK/libSalesforceSDK.a(SFNativeRestAppDelegate.o)
duplicate symbol _OBJC_IVAR_$_SFNativeRestAppDelegate._window in:
    /Volumes/Wallace/Users/gromitt/Library/Developer/Xcode/DerivedData/ClientApp-bpccblcllzkzvudxtwutuqliagld/Build/Intermediates/ClientApp.build/Debug-iphonesimulator/ClientApp.build/Objects-normal/i386/SFNativeRestAppDelegate.o
    /Volumes/Wallace/Users/gromitt/Documents/Out to Lunch/ iOS Apps/ClientApp/ClientApp/dependencies/SalesforceSDK/libSalesforceSDK.a(SFNativeRestAppDelegate.o)
duplicate symbol _OBJC_METACLASS_$_SFNativeRestAppDelegate in:
    /Volumes/Wallace/Users/gromitt/Library/Developer/Xcode/DerivedData/ClientApp-bpccblcllzkzvudxtwutuqliagld/Build/Intermediates/ClientApp.build/Debug-iphonesimulator/ClientApp.build/Objects-normal/i386/SFNativeRestAppDelegate.o
    /Volumes/Wallace/Users/gromitt/Documents/Out to Lunch/ iOS Apps/ClientApp/ClientApp/dependencies/SalesforceSDK/libSalesforceSDK.a(SFNativeRestAppDelegate.o)
duplicate symbol _kDefaultLoginHost in:
    /Volumes/Wallace/Users/gromitt/Library/Developer/Xcode/DerivedData/ClientApp-bpccblcllzkzvudxtwutuqliagld/Build/Intermediates/ClientApp.build/Debug-iphonesimulator/ClientApp.build/Objects-normal/i386/SFNativeRestAppDelegate.o
    /Volumes/Wallace/Users/gromitt/Documents/Out to Lunch/ iOS Apps/ClientApp/ClientApp/dependencies/SalesforceSDK/libSalesforceSDK.a(SFAccountManager.o)
ld: 6 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Any help is appreciated. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:08:09+00:00Added an answer on June 11, 2026 at 5:08 pm

    So this is more than a little embarrassing, but I don’t want people to keep trying to answer this problem so here goes:

    I had two copies of SFNativeAppDelegate.h added to my app. I was looking through the files included in the SF Mobile SDK, and I must have skipped over it. So I added it a second time, and that’s when my problems started.

    I have it working now. Here’s what I did:

    1. Create a Native app using the SalesForce project template.
    2. Go to your Native app’s directory in the Finder. Copy the dependencies directory into your existing project.
    3. Open the Native project in XCode and copy over the Settings.bundle to your existing project. Grab the SFAuthorizingViewController.xib while you’re in there, too. Close the Native project. You don’t need it anymore.
    4. Open your existing app’s plist file. Add a key named SFDCOAuthLoginHost, and set it to either test.salesforce.com or login.salesforce.com
    5. In your existing app delegate, include SFNativeAppDelegate.h, SFOAuthCoordinator.h and
      SFOAuthCredentials.h
    6. Change the interface declaration line from this:

      @interface YourAppDelegate : UIResponder <UIApplicationDelegate>
      

      …to this:

      @interface YourAppDelegate : SFNativeRestAppDelegate
      
    7. Add two properties to YourAppDelegate:

      @property (nonatomic, readonly) SFOAuthCoordinator *coordinator;
      @property (nonatomic, retain) SFAuthorizingViewController *authViewController;
      
    8. Go to YouAppDelegate.m. Add the following lines:

      // Fill these in when creating a new Remote Access client on Force.com
      static NSString *const RemoteAccessConsumerKey = @"...yourConsumerKeyGoesHere...";
      static NSString *const OAuthRedirectURI = @"https://test.salesforce.com/services/oauth2/success";
      
    9. Add these methods as well (the Authorizing Coordinator was the secret sauce I was missing)

        #pragma mark - Salesforce.com login helpers
      
          - (NSString*)remoteAccessConsumerKey {
              return RemoteAccessConsumerKey;
          }
      
          - (NSString*)oauthRedirectURI {
              return OAuthRedirectURI;
          }
      
          -(NSString *)oauthLoginDomain {
              return @"test.salesforce.com";
          }
      
          -(void)login{
             [self.coordinator authenticate];
          }
      
          - (void)logout {
              [self.coordinator revokeAuthentication];
              [self.coordinator authenticate];
          }
      
          - (void)loggedIn {
              //provide the Rest API with a reference to the coordinator we used for login
              [[SFRestAPI sharedInstance] setCoordinator:self.coordinator];
              //[[SFRestAPI sharedInstance] setApiVersion:@"24.0"];
          }
      
          - (UIViewController*)newRootViewController {
              NSLog(@"You must override this method in your subclass");
              [self doesNotRecognizeSelector:@selector(newRootViewController)];
              return nil;
          }
      
          - (SFOAuthCoordinator*)coordinator {
              //create a new coordinator if we don't already have one
              if (nil == _coordinator) {
      
                  NSString *appName = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString*)kCFBundleNameKey];
                  NSString *loginDomain = [self oauthLoginDomain];
                  NSString *accountIdentifier = [self userAccountIdentifier];
                  //here we use the login domain as part of the identifier
                  //to distinguish between eg  sandbox and production credentials
                  NSString *fullKeychainIdentifier = [NSString stringWithFormat:@"%@-%@-%@",appName,accountIdentifier,loginDomain];
      
      
                  SFOAuthCredentials *creds = [[SFOAuthCredentials alloc]
                                               initWithIdentifier:fullKeychainIdentifier
                                               clientId: [self remoteAccessConsumerKey] encrypted:NO ];
      
      
                  creds.domain = loginDomain;
                  creds.redirectUri = [self oauthRedirectURI];
      
                  SFOAuthCoordinator *coord = [[SFOAuthCoordinator alloc] initWithCredentials:creds];
                  coord.scopes = [[self class] oauthScopes];
      
                  coord.delegate = self;
                  _coordinator = coord;
              }
      
              return _coordinator;
          }
      

    Now you’re ready to make a call using the SFRestAPI. If the user hasn’t already logged in, the SalesForce authentication page will appear the first time you try to use it.

    Thanks to everyone who tried to help. Again, super-embarrassed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.