title: Write BOOL value to plist from a button
body: <p><strong>Background</strong></p>
  
  <p>I have 2 tableViews, the first one is the Main table and the second one is the Favorites table.</p>
  
  <p>Everything is handled with a plist.</p>
  
  <p>From the detailView of the first table, in the upper-corner I set up a button to write to the plist the value YES.</p>
  
  <p>The plist is structured this way:</p>
  
  <pre><code>Section 1                  Dictionary
        Title                String
        Rows                 Array 
          Item 0             Dictionary
             name            String
             description     String
             image           String
             isFav           Bool (default NO)
        Item 1               Dictionary
             name            String
             description     String
             image           String
             isFav           Bool (default NO)
  
  Section 2
        Title
        Rows
          Item 0             Dictionary
             name            String
             description     String
             image           String
             isFav           Bool (default NO)
          etc..
  </code></pre>
  
  <p>Adding a little scheme of how it should work:</p>
  
  <pre><code>firstTable          detailView                          plist
   __________          ________                   
  |          |        |     |★ |&lt;- button pressed ---&gt; cellname isFav = YES      
  |__________|        |        |               
  |cellname  | ------&gt;| detail |    
  |__________|        |        |               
  |          |        |        |               
  |          |        |        |                
  </code></pre>
  
  <p><strong>The problem</strong></p>
  
  <p>Now that I have that button, I was trying to write a method to write the isFav bool value to the plist. </p>
  
  <p><code>-(void)makeFavorite</code></p>
  
  <p>I already had a method to read the plist, but I don't know how to write a value on it.
  I tried to search on google and read other stackOverflow posts but I can't really figure it out.
  Any help appreciated! </p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is the method do read the plist</p>
  
  <pre><code>- (NSArray*)readPlist 
  { 
      NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); 
      NSString *plistPath = [[documentPaths lastObject] stringByAppendingPathComponent:@"tipsList.plist"]; 
  
      NSFileManager *fMgr = [NSFileManager defaultManager]; 
      if (![fMgr fileExistsAtPath:plistPath]) { 
          plistPath = [[NSBundle mainBundle] pathForResource:@"tipsList" ofType:@"plist"]; 
  
      } 
      return [NSArray dictionaryWithContentsOfFile:plistPath];
  }
  </code></pre>
  
  <p>And in the method I was typing:</p>
  
  <pre><code>- (void) makeFavorite:(id)sender
   {   
       NSArray *test = [self readPlist];
       NSLog (@"test: %@",test);
      //write plist instructions then
   }
  </code></pre>