title: How to store NSMutableArray to NSUserDefaults and show results in TableView?
body: <p>I want to save the Notifications which come from server in my application and also make a User Interface to give users the ability of chosing which Notification(message) to read. In a scheduled method my client controls for changes inside the server and the communication is in JSON format. I have parsed it and can see the results in <code>NSLog(@"....",..)</code> too. I also control the status of message from the server, if the status equals to 1 i will save the message and add a node to TableView.. Now, can anyone help me about how to transmit datas in <code>NSMutableArray</code> both to <code>NSUserDefaults</code> and TableView? I can Share code or JSON representation too if you want.. 
  It will be better if you could explain with some code.. Thanks</p>
  
  <p>I decided to share some of my code, </p>
  
  <p>as i have writen under the code too, i want to display <code>NSMutableArray</code> in <code>UITableView</code></p>
  
  <pre><code>    `-(IBAction)Accept:(id)sender
      {   userName=[[NSString alloc] initWithString:userNameField.text ];
          [userNameField setText:userName];
          NSUserDefaults *userNameDef= [NSUserDefaults standardUserDefaults];
          [userNameDef setObject:userName forKey:@"userNameKey"];
          password =[[NSString alloc] initWithString:passwordField.text];
          [passwordField setText:password];
          NSUserDefaults *passDef=[NSUserDefaults standardUserDefaults];
          [passDef setObject:password forKey:@"passwordKey"];
          serverIP=[[NSString alloc] initWithString: serverField.text];
          [serverField setText:serverIP];
          NSUserDefaults *serverDef=[NSUserDefaults standardUserDefaults];
          [serverDef setObject:serverIP forKey:@"serverIPKey"];
          [userNameDef synchronize];
          [serverDef synchronize];
          [passDef synchronize];
  
  
      UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"BNTPRO "
                                                        message:@"Your User Informations are going to be sent to server. Do you accept?"
                                                       delegate:self
                                              cancelButtonTitle:@"OK"
                                              otherButtonTitles:@"Cancel",  nil];
      [message show];
  }
  
  
  
      - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
      {
          NSString *title = [alertView buttonTitleAtIndex:buttonIndex];
  
          if([title isEqualToString:@"OK"])
          {
              if([userNameField.text isEqualToString:@""]|| [passwordField.text isEqualToString:@""] || [serverField.text length]&lt;10) 
              {
                  UIAlertView *message1 = [[UIAlertView alloc] initWithTitle:@"BNTPRO "
                                                                     message:@"Your User Informations are not defined properly!"
                                                                    delegate:nil
                                                           cancelButtonTitle:@"OK"
                                                           otherButtonTitles:  nil];
  
                  [message1 show];
  
  
          [userNameField  resignFirstResponder];
              [passwordField resignFirstResponder];
              return;
          }
          //## GET code to here**
          NSString *str1=[@"?username=" stringByAppendingString:userNameField.text];
          NSString *str2=[@"&amp;password=" stringByAppendingString:passwordField.text];
          NSString *str3=[str1 stringByAppendingString:str2];
          NSString *str4 =[@"http://" stringByAppendingString:serverField.text];
  
  
          NSURL *url=[NSURL URLWithString:[str4 stringByAppendingString:[@"/ipad/login.php" stringByAppendingString:str3]]];
          NSLog(@"%@\n",url);
          //get the url to jsondata
          NSData *jSonData=[NSData dataWithContentsOfURL:url];
  
          if (jSonData!=nil) {
              NSError *error=nil;
              id result=[NSJSONSerialization JSONObjectWithData:jSonData options:
                         NSJSONReadingMutableContainers error:&amp;error];
              if (error==nil) {
                  NSDictionary *mess=[result objectForKey:@"message"];
                  NSDictionary *messContent=[mess valueForKeyPath:@"message"];
                  NSDictionary *messDate=[mess valueForKeyPath:@"date"];
                  NSDictionary *messID=[mess valueForKeyPath:@"ID"];
                  NSDictionary    *messStatus=[mess valueForKey:@"status"];
  
                  NSLog(@"%@ *** Message %@ \n Message Content: %@ \n Mesage ID: %@ \n Message Date: %@\n \nilhancetin MessageSatus: %@", result, mess, messContent, messID,messDate,messStatus);
                  NSString*key1=[ result objectForKey:@"key" ];
  
                  NSString *s1=[@"http://" stringByAppendingString:serverField.text];
                  NSString *s2=[s1 stringByAppendingString:@"/ipad/button.php"];
                  NSURL *url2=[NSURL URLWithString:[s2 stringByAppendingString:[@"?key=" stringByAppendingString:key1]]];
                  NSLog(@"\n%@\n",url2 );
                  NSData *data2=[NSData dataWithContentsOfURL:url2];
                  id result2=[NSJSONSerialization JSONObjectWithData:data2 options:NSJSONReadingMutableContainers error:nil];
  
                  NSMutableArray *mesID = [NSMutableArray array];//saving meesages to NSMutableArray
                  NSMutableArray *status = [NSMutableArray array];    
  
  
                  // i logged here and it saves  the data, now i want to display my data in table view
  </code></pre>
  
  <p>`</p>