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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:14:33+00:00 2026-06-14T15:14:33+00:00

Here is my problem: I have a Core Data- Document based program with ARC

  • 0

Here is my problem:
I have a Core Data- Document based program with ARC ( Automatic Reference Counting);
I want the tableView shows some data at the beginning.
but I receive nothing.
Here is what I have done:

1- I made a core data with Entity: MyData

enter image description here

2- then I added a NSArrayController and bound it to managedObjectContext and MyData

enter image description here

enter image description here

3- I bonded the arrayController to col0:

enter image description here

4- then made and outlet and added @synthesize for the arrayController :

enter image description here

5- Finally added this code:

  • (void)windowControllerDidLoadNib:(NSWindowController *)aController {

    [super windowControllerDidLoadNib:aController];

    for (NSUInteger i=0; i<5; i++) {

    [myArrayController add:self];
    
    [myArrayController setSelectionIndex: i];
    
    [myArrayController setValue:@"test" forKeyPath:@"selection.col0"];
    
    NSLog(@"%lu",[myArrayController selectionIndex]);
    

    } }

But this is the problem: nothing happens and the SelectionIndex shows strange numbers!!

enter image description here

Any help appreciated

  • 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-14T15:14:34+00:00Added an answer on June 14, 2026 at 3:14 pm

    After one month nobody answered me ! finally I could handle it:

    NSError* error;

    NSInteger count=0;
    
    NSNumber* N=[[NSNumber alloc]initWithInt:0];
    
    NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init];
    
    NSEntityDescription * entityMyData  = [NSEntityDescription entityForName:@"MyData"
                                                      inManagedObjectContext:[self managedObjectContext]];
    
    [fetchRequest setEntity:entityMyData];
    
    
    count=[self.managedObjectContext countForFetchRequest:fetchRequest error:&error];
    
    
    
        if (count==0 ) {
            
    
            for (NSInteger i=count+1; i<RowsToAdd+count+1; i++) {
    
                N=@(i);
    
                managedObject = [NSEntityDescription insertNewObjectForEntityForName:@"MyData"
                                                              inManagedObjectContext:[self managedObjectContext]];
    
                [managedObject setValue:N forKey:@"col0"];
    
                [managedObject setValue:N forKey:@"col1"];
    
                
            }
    
           
          
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a document based App using Core Data, and have a tableView which
I have a document based application running with core data. The object model has
Really weird problem. I have a tableView that pulls data out of a Core
Here's the core problem: I have a .NET application that is using COM interop
Here's the problem: I have a data-bound list of items, basically a way for
I think I have a problem, maybe linked to a retain cycle in Core-Data.
I'm currently facing in problem using Core Data. I have two entities A and
I have a problem with Core Data in my iOS app. First off, the
Hi I do have a problem with my Core Data storage! I delete it
I'm having a problem with Core Data. I have two Entities (Article and Manufacturer)

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.