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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:54:38+00:00 2026-06-06T04:54:38+00:00

I have a UITableView populated by a feed from searchtwitter.com. I also have a

  • 0

I have a UITableView populated by a feed from searchtwitter.com. I also have a details table with an image and UILabel. I have all this working, but I want to add a UIButton on the detail page that will save the UIImage and the label into a property list. I’m very new to this; here is what I have so far (not working).

- (IBAction)SaveFriend:(id)sender
{
    NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

    NSString *documentDirectory = [path objectAtIndex:0];

    NSString *plistPath = [documentDirectory stringByAppendingPathComponent:@"TwitterFriends.plist"]; 

    NSDictionary * tweet = [[NSDictionary alloc]init];

    NSString *text =  [tweet objectForKey:@"from_user"];
    NSString *user = [tweet objectForKey:@"from_user_name"];

    personName.text = text;
    personInfo.text = user;  

    // create dictionary with values in UITextFields
    NSDictionary *plistDict = [NSDictionary dictionaryWithObjects: [NSArray arrayWithObjects: personName, personInfo, nil] forKeys:[NSArray arrayWithObjects: @"Name", @"info", nil]];

    NSString *error = nil;
    // create NSData from dictionary
    NSData *plistData = [NSPropertyListSerialization dataFromPropertyList:plistDict format:NSPropertyListXMLFormat_v1_0 errorDescription:&error];

    // check is plistData exists
    if(plistData) 
    {
        // write plistData to our Data.plist file
        [tweet writeToFile:plistPath atomically:YES];
    }
    else 
    {
        NSLog(@"Error in saveData: %@", error);
       [error release];
    }
}
  • 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-06T04:54:39+00:00Added an answer on June 6, 2026 at 4:54 am

    Instead of using a .plist, try using an NSArray or NSMutableArray and then the writeToFile method. For example:

    NSMutableArray *temp = [NSMutableArray new];
    [temp addObject:image];
    [temp addObject:label];
    [temp writeToFile:[self saveFilePath:@"filename"] atomically:YES];
    
    
    //Returns the saved information path
    - (NSString*) saveFilePath: (NSString *) add
    {
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES);
        NSString *path = [paths objectAtIndex:0];
        NSString *filename = [path stringByAppendingPathComponent:add];
        return filename;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array of dictionaries from a JSON feed. This populates a UITableView
I have a working UITableView in my view controller. It is being successfully populated
I have a UITableView which I want to populate with details from an array
I have a UITableView that gets populated from CoreData via a controller that implements
I have a uitableview that is populated from a sqlite query. I want to
My iPad app features a UITableView populated from a feed. Like most RSS readers,
I have an UITableView populated with a Twitter timeline. I also have scroll to
I have a UITableView that gets populated my a NSMutableArray. This is how I
I have a UITableView populated with a mutablearray that is read from NSUserDefaults. I
I have a UITableView that is being populated from an NSMutable array that has

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.