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 6838741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:38:01+00:00 2026-05-26T23:38:01+00:00

I created a project for iPad which uses Apple’s Use CoreData template. I customized

  • 0

I created a project for iPad which uses Apple’s "Use CoreData" template.

I customized several things, e.g. the names of the objects, but the system stayed the same.

Apple uses a MasterViewController.h which is a UITableViewController und a DetailViewController.h which is a simple UIViewController. Once you have selected one of the objects in the UITableView in MasterViewController.h it gives its attributes to the DetailViewController.

Now the problem:

I created a third view controller, named ResultsViewController.h which should display all the data (attributes of the objects).

I want to use one or more NSArray(s), which should contain all my data (not just the selected but all. So if you created 5 objects, you want to have 5 times NSArray).

(1) How can I fetch the values of the xcoredatamodel to be able to access them in ResultsViewController? Sending a fetch request did not work for me?

(2) How can I determine how many objects I created in my UITableView (MasterViewController.h)?

CoreData Structure:

Simple, one entity, several attributes, that is it!

Thanks a lot!

  • 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-05-26T23:38:01+00:00Added an answer on May 26, 2026 at 11:38 pm

    First: you should not put all your data into arrays. This will result in memory problems once your data volume grows. Core data is actually designed to fetch the data you need very efficiently without the need of maintaining expensive parallel data structures.

    So the preferred way is to pass the same NSManagedObjectContext to the ResultsViewControllerand have it fetch its own data as needed.

    However, if you really want to fetch all the data, it is simple.

    NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
    NSEntityDescription *entity = [NSEntityDescription entityForName:@"EntityName"
          inManagedObjectContext:self.managedObjectContext];
    [fetchRequest setEntity:entity];
    NSError *error = nil;
    NSArray *fetchedObjects = [self.managedObjectContext
          executeFetchRequest:fetchRequest error:&error];
    [fetchRequest release];
    

    The array fetchedObjects now contains all of your data. You can access the attributes in the usual way (e.g. with dot notation or KVC).

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

Sidebar

Related Questions

I've created TFS project based on MSF for CMMI process template. For any type
I created a new SplitView iPad project in Xcode and setup the code to
I have taken a project based on the standard iPad SplitViewerController template and implemented
Using Xcode 4.x I created a SplitView project for iPad From RootViewController I'm trying
I've created an iPad game using the Universal App Xcode template. Since I'm in
I'm about to start a new iphone/ipad project which required a library of images.
I created a new class in my project with a xib target for Ipad;
I have a MonoTouch project from a year ago which was created as a
I have a C++ class I would like to use in an iPhone/iPad project
I created a project in flex builder with application server type set to none.

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.