title: How to port an existing data structure to a plist?
body: <p>I am a noob and I can't figure out how to port my in app data to a plist so that I can put it on a server.</p>
  
  <p>I followed an online tutorial, and it works great, but I can't comprehend how the app is actually made so that I can remotely update it.</p>
  
  <p>I have tried alot of books, online sources and contacted the lynda.com instructor but still haven't figured this out in 6 months.</p>
  
  <p>It's driving me nuts. I think the way the app is set up is confusing me. Anyhow, I am turning to the gurus for help in a last ditch effort.</p>
  
  <p>** first post, so I'll try to include all that I think is relevant, but let me know if more info is needed**</p>
  
  <p>Basically, using storyboards, I've got a tableview that goes to another view to display an image and more info based on the cell selected. So I think what I need is a plist that has an array of dictionaries in it.</p>
  
  <p>Here's the original code, not using a plist:</p>
  
  <pre><code>//Data.h
  
  #import &lt;Foundation/Foundation.h&gt;
  
  @interface Data : NSObject
  
  @property (nonatomic, strong) NSString *name;
  @property (nonatomic, strong) NSString *filename;
  @property (nonatomic, strong) NSString *notes;
  
  @end
  </code></pre>
  
  <p>//  Data.m
      #import "Data.h"</p>
  
  <pre><code>@implementation Data
  
  
  @synthesize name,filename,notes;
  
  @end
  
  
  //  TableViewController.h
  
  
  #import &lt;UIKit/UIKit.h&gt;
  #import "Data.h"
  #import "DisplayViewController.h"
  
  
  
  @interface TableViewController : UITableViewController
  
  @end
  
  /
  //  TableViewController.m
  //
  
  #import "TableViewController.h"
  
  @interface TableViewController ()
  
  @end
  
  @implementation TableViewController
  
  NSMutableArray *subjects;
  
  -(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
  
      if ([segue.identifier isEqualToString:@"ShowData"]  ){
  
          DisplayViewController *dvc = [segue destinationViewController];
          NSIndexPath *path = [self.tableView indexPathForSelectedRow];
          Data *c = [subjects objectAtIndex:path.row];
          [dvc setCurrentData:c];
      }
  }
  
  
  - (id)initWithStyle:(UITableViewStyle)style
  {
      self = [super initWithStyle:style];
      if (self) {
      }
      return self;
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      subjects = [[NSMutableArray alloc] init];
  
      Data *object = [[Data alloc] init];
  
      [object setName:@"testname1"];
          [object setFilename:@"testname1.png"];
          [object setNotes:@"detail description for test name 1"];
      [subjects addObject:object];
  
      object = [[Data alloc] init];
      [object setName:@"testname2"];
      [object setFilename:@"testname2.png"];
      [object setNotes:@"detail description for test name 2"];
      [subjects addObject:object];
  
      object = [[Data alloc] init];
      [object setName:@"testname3"];
      [object setFilename:@"testname3.png.png"];
      [object setNotes:@"detail description for test name 3"];
      [subjects addObject:object];
  
  }
  
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  #pragma mark - Table view data source
  
  - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
  {
  
      return 1;
  }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
  
      return [subjects count];
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *CellIdentifier = @"DataCell1";
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
  
      // Configure the cell...
  
      Data *current = [subjects objectAtIndex:indexPath.row];
      [cell.textLabel setText:[current name]];
  
  
      return cell;
  }
  
  #pragma mark - Table view delegate
  
  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
     }
  
  @end
  
  
  //  DisplayViewController.h
  
  
  #import &lt;UIKit/UIKit.h&gt;
  #import "Data.h"
  #import "InfoViewController.h"
  
  @interface DisplayViewController : UIViewController
  
  @property (strong, nonatomic) Data *currentData;
  @property (weak, nonatomic) IBOutlet UIImageView *currentImage;
  
  @end
  </code></pre>
  
  <hr>
  
  <pre><code>//  DisplayViewController.m
  
  #import "DisplayViewController.h"
  
  @interface DisplayViewController ()
  
  @end
  
  @implementation DisplayViewController
  
  @synthesize currentData;
  
  - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  {
      self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
      if (self) {
          // Custom initialization
      }
      return self;
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      UIImage *image  = [UIImage imageNamed:[currentData filename]];
  
      [self.currentImage setImage:image];
      [self setTitle:[currentData name]];
  }
  
  -(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender   {
  
      InfoViewController *ivc = [segue destinationViewController];
      [ivc setCurrentData:[self currentData]];
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  @end
  </code></pre>