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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:18:28+00:00 2026-06-03T04:18:28+00:00

I have a ViewController and a separate UITableViewController. Now there is an array loaded

  • 0

I have a ViewController and a separate UITableViewController. Now there is an array loaded in the applications appDelegate file, but I do not want to automatically load this. Now I have this code from when I was learning Core Data (still a progress) that detects if the Database is empty, if so then it would insert a default array by calling this method.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self setupFetchedResultsController];

if (![[self.fetchedResultsController fetchedObjects] count] > 0 ) {
    NSLog(@"!!!!! ~~> There's nothing in the database so defaults will be inserted");
    [self importCoreDataDefaultRoles];
}
else {
    NSLog(@"There's stuff in the database so skipping the import of default data");
}

Now as you can see the if statement checks if the count returned is greater than 0.

My question is Can you check this without the use of Core Data? Like with any tableView.

My goal is for the end user to be able to load data into the TableView witha normal NSMutabelArray, but do so via an IBAction button, rather than loading automatically in the viewDidLoad – Just setting myself an exercise:-)

Cheers Jeff

  • 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-03T04:18:29+00:00Added an answer on June 3, 2026 at 4:18 am

    You can at the beginning show default data in the table using an empty array and the when user clicks the button you can insert data in the source array and refresh the table with

      [tableView reloadData];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a viewcontroller with a textview and a label and i want to
I have a ViewController class called GamePlay. In GamePlay there is a nested class
I have a viewcontroller like the following. But the touchsBegan doestnt get detected. Can
I have a ViewController that has its own NIB. I would like to embed
I have a viewController that autorotates just fine, The problem is that is I
i have more viewcontroller that start from rootviewcontroller. So for example i start with
I have a ViewController and UIWebView created in Interface Builder in it. I fill
For example I have a ViewController named firstViewController. Then I would like to call
I'm developing an iOS 4 application. I have this ViewController: @interface BlogViewController : UIViewController
Here's my ultimate goal in all of this. I have a viewcontroller with a

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.