title: how to show dictionary data in tableview
body: <p>I have created an array and its data are shown in a tableview. Now I want to add dictionary data to that array and show it in the same tableview. I created a button which will add the dictionary value to the array but I am not able to see the data in the tableview. </p>
  
  <p>Here is my "ViewController.m" </p>
  
  <pre><code>#import "ViewController.h"
  @interface ViewController ()
  @end
  @implementation ViewController
  - (void)viewDidLoad
  {
  [super viewDidLoad];
  mArray = [[NSMutableArray alloc]initWithObjects:@"one",@"two",@"three",@"four",@"five",@"six",@"seven",@"eight",@"nine",@"ten", nil];
  mDictionary = [[NSMutableDictionary alloc]init];
  [mDictionary setValue:@"gfhhgfhf" forKey:@"firstname"];
  [mDictionary setValue:@"hhgghf" forKey:@"lastname"];
  CGRect frame = self.view.frame;
  UITableView *tableView = [[UITableView alloc]initWithFrame:frame style:UITableViewStylePlain];
  tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine;
  tableView.backgroundColor = [UIColor cyanColor];
  tableView.separatorColor = [UIColor blackColor];
  tableView.delegate = self;
  tableView.dataSource = self;
  UIButton *button = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
  button.frame = CGRectMake(200, 400, 100, 30);
  [button setTitle:@"ADD" forState:UIControlStateNormal];
  [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
  [button addTarget:self action:@selector(addValueInArray) forControlEvents:UIControlEventTouchUpInside];
  [self.view addSubview:tableView];
  [self.view addSubview:button];
  }
  -(void)addValueInArray{
  [mArray addObject:(mDictionary)];
  [mArray reloadData];
  }
  - (void)didReceiveMemoryWarning
  {
  [super didReceiveMemoryWarning];
  }
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  return mArray.count;
  }
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:  (NSIndexPath *)indexPath{
  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
  if (!cell) {
      cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault   reuseIdentifier:@"cell"];
  }
  cell.textLabel.text = [mArray objectAtIndex:indexPath.row];
      return cell;
  }
  - (void)dealloc
  {
  [mArray release];
  [super dealloc];
  }
  @end
  </code></pre>