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

  • SEARCH
  • Home
  • 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 8190983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:48:36+00:00 2026-06-07T03:48:36+00:00

I am having some issues implementing RestKit/CoreData with my application. Using the RKTwitterCoreData example

  • 0

I am having some issues implementing RestKit/CoreData with my application. Using the RKTwitterCoreData example application and pointing it to my web service for the json feed, I get the resulting tableview:

Duplicate objects/ID not being displayed correctly

The issues encountered so far:

  1. Refresh generates a new core data entry even though i have primaryKeyAttribute set to the orderID.
  2. cell textLabel displays an odd orderID that doesn’t match with my web service

Here is my applicationDidFinishLaunchingWithOptions:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Initialize RestKit
RKObjectManager* objectManager = [RKObjectManager managerWithBaseURLString:@"http://mywebservice.com"];

// Enable automatic network activity indicator management
objectManager.client.requestQueue.showsNetworkActivityIndicatorWhenBusy = YES;

NSString *databaseName = @"RKTwitterData.sqlite";
objectManager.objectStore = [RKManagedObjectStore objectStoreWithStoreFilename:databaseName usingSeedDatabaseName:nil managedObjectModel:nil delegate:self];

RKManagedObjectMapping* statusMapping = [RKManagedObjectMapping mappingForClass:[Order class] inManagedObjectStore:objectManager.objectStore];
statusMapping.primaryKeyAttribute = @"orderID";
[statusMapping mapKeyPath:@"id" toAttribute:@"orderID"];
[statusMapping mapAttributes:@"created_at", nil];

// Register our mappings with the provider
[objectManager.mappingProvider setObjectMapping:orderMapping forResourcePathPattern:@"/orders"];

// Create Window and View Controllers
RKTwitterViewController* viewController = [[[RKTwitterViewController alloc] initWithNibName:nil bundle:nil] autorelease];
UINavigationController* controller = [[UINavigationController alloc] initWithRootViewController:viewController];
UIWindow* window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
[window addSubview:controller.view];
[window makeKeyAndVisible];

return YES;
}

And the json result at /orders:

enter image description here

Any advice for dealing with this issue? Thanks!

  • 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-07T03:48:37+00:00Added an answer on June 7, 2026 at 3:48 am

    Doh! The reason was because the twitter API isn’t key value coding compliant. Once i changed:

     [objectManager.mappingProvider setObjectMapping:orderMapping forResourcePathPattern:@"/orders"];
    

    with:

     [objectManager.mappingProvider setObjectMapping:orderMapping forKeyPath:@"orders"];
    

    It worked again!

    Thanks and hope it helps someone.

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

Sidebar

Related Questions

I'm creating a shopping cart application and I'm having some issues with implementing a
I'm having some issues implementing JPA 2.0 in my app. I'm using Criteria queries
I'm having some issues implementing a TimePicker in my application that allows the user
I'm having some issues to deserialize a Json array that follows this format: [
I'm having some issues with implementing a logarithm class with operator overloading in C++.
So, I'm having some issues here implementing this math problem in C++. Let's say
I am having a simple web application which has some static pages. The URL
I am having some issues trying to create page navigation using php, I have
Having some issues getting my head around the differences between UTF-8, UTF-16, ASCII and
Having some issues with the ... in ObjectiveC. I'm basically wrapping a method and

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.