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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:38:13+00:00 2026-06-07T18:38:13+00:00

I use a plist containing of an array of dictionaries to fill a MainTableViewController

  • 0

I use a plist containing of an array of dictionaries to fill a MainTableViewController through a MutableArray. When a cell is chosen, the reprecented dictionary are passed to the DetailViewController, where the values from the strings in the reprecented dictionary are displayed. I’ve added a button to the DetailView in the storyboard, and I want this button to send the reprecented dictionary to the Favorites tab, which is called FavoritesTableViewController. I’m thinking of ways to do it but I’m new to programming so I have to ask for advice.

I’ve come up with two possible ways of doing it. I may be far away from the right answer, but at least I’m trying to think.

1: The button changes a boolean to yes in the reprecented dictionary, and the prototype cell in the FavoritesViewController are told to display the dictionaries with boolean=yes.

2: The button copies the dictionary to a new plist with favourites, displayed in the favourites tableview.

But I really have no idea..

EDIT:

Code so far in the DetailViewController:

-(IBAction)FavoriteButton:(id)sender
{
    [[NSNotificationCenter defaultCenter] postNotificationName:@"ItemSelected"
                                                    object:selectedObject];


}

Code so far to display the wines in the FavoritesViewController:

[[NSNotificationCenter defaultCenter] addObserverForName:@"ItemSelected"
                                                  object:nil
                                                   queue:[NSOperationQueue mainQueue]
                                              usingBlock:^(NSNotification* notif) {
                                                  [favoritedObjects release];
                                                  favoritedObjects = [[notif object] retain];
                                                  [self.tableView reloadData];
                                              }];

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [favoritedObjects count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Favcell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

// Configure the cell...

    NSString *cellValue = [favoritedObjects valueForKey:@"Name"];
    cell.textlabel.text = cellValue;

    return cell;
}

This shows 20 cells with the value from the Key: “Name” from the last Object in the DetailViewController I pressed “Add to Favorites” button for. For example if I add “Gato Negro” to favorites, it displays “Gato Negro” in 20 cells. if I then add “Luna” to fav, it displays “Luna” in the 20 cells in FavoritesViewController.

  • 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-07T18:38:14+00:00Added an answer on June 7, 2026 at 6:38 pm

    How about posting a notification and passing the selected dictionary as the object or userInfo?

    [[NSNotificationCenter defaultCenter] postNotificationName:@"ItemSelected"
                                                        object:mySelectedDictionary];
    

    In the FavoritesViewController you just subscribe to this notification (e.g. in the init method) like this:

    [[NSNotificationCenter defaultCenter] addObserverForName:@"ItemSelected"
                                                      object:nil
                                                       queue:[NSOperationQueue mainQueue]
                                                  usingBlock:^(NSNotification* notif) {
                                                      [dictionaryToShow release];
                                                      dictionaryToShow = [[notif object] retain];
                                                      [self.tableView reloadData];
                                                  }];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was trying to use a plist to store an array with the below
I'm trying to make use of a dictionary plist as shown below: I read
I need to use a plist from an existing iOS app in my android
When I use NSKeyedArchiver is the data that is written a *.plist, I have
Whenever I want to get data from a plist file I use the following
I've created a plist. I want to use a UIsegmentedControl with 3 sections. Each
I would like to edit a plist from Xcode which I will use to
Why does apple use .plist files? Windows uses .ini files, which may be less
I need to save about 14 NSDictionaries to a plist. Each Dictionary is going
I want to be able to use a plist for settings Im implementing in

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.