title: detailtableview controller to push the image from tableview
body: <p>hi I'm trying to view the image and description form tableview to detailviewcontroller  but not I'm not able get it. I'm fetching the image form server i have stored the image url and using the json and php coding  I'm getting the image url using the NSURLConnectionDelegate viewing the images and description in tableview .</p>
  
  <p>i have trying many ways to view those images in the tableview but getting the images.</p>
  
  <p>detailview controller.h file coding</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import "image.h"
  @class image;
  @interface viewdetailpoliticalViewController : UIViewController&lt;NSURLConnectionDelegate&gt;
  {
    NSURLConnection *connection;
  }
  
  
      @property (strong,nonatomic) NSString *value;
      @property (strong,nonatomic) UIImage *imm;
  
      @property (strong, nonatomic) IBOutlet UIImageView *imageview;
      @property (strong, nonatomic) IBOutlet UILabel *dcp
      @property (strong, nonatomic) NSMutableData *responseData;
  
   -(void)setDataSource:(image *)inImageOb;
    @end
  </code></pre>
  
  <p>this is my detailview controller.m file coding</p>
  
  <pre><code>  #import "viewdetailpoliticalViewController.h"
    #import "image.h"
    @interface viewdetailpoliticalViewController ()
  
    @end
  
    @implementation viewdetailpoliticalViewController
    @synthesize imageview,dcp;
    @synthesize value,imm;
  
   - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
    {
      self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
     if (self) {
        // Custom initialization
    }
       return self;
    }
  
    - (void)viewDidLoad
   {
      [super viewDidLoad];
  
      self.imageview.image = self.imm;
      self.dcp.text = self.value;
  // Do any additional setup after loading the view.
   }
  
   - (void)didReceiveMemoryWarning
  {
     [super didReceiveMemoryWarning];
  // Dispose of any resources that can be recreated.
  }
  
  
   -(void)setDataSource:(image *)inImageOb
   {
     self.value = inImageOb.desp;
  
  
     NSURL *url = [NSURL URLWithString:inImageOb.img];
     NSURLRequest *request = [NSURLRequest requestWithURL:url];
     connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
     self.responseData = [[NSMutableData alloc] init];
  
   }
  
  
  - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data;
  {
       [self.responseData appendData:data];
  }
  
  - (void)connectionDidFinishLoading:(NSURLConnection *)connection;
  {
      UIImage *image = [UIImage imageWithData:self.responseData];
      self.imm = image;
  }
  
  
  @end
  </code></pre>
  
  <p>this is my tableview controller m file coding:</p>
  
  <pre><code>   - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [self performSegueWithIdentifier:@"Detailsegue" sender:indexPath];
       }
     - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
          if ([segue.identifier isEqualToString:@"Detailsegue"]) {
  
      viewdetailpoliticalViewController *detailvc = (viewdetailpoliticalViewController *)segue.destinationViewController;
  
       NSIndexPath *indexPath =[self.mytableview indexPathForSelectedRow];
  
      [detailvc setDataSource:[imgevery objectAtIndex:indexPath.row]];
  
  
    }
  }
  </code></pre>
  
  <p>this is code i have used to fetch the datas using json</p>
  
  <pre><code>  -(void) retrieveData
  {
     NSURL * url = [NSURL URLWithString:getDataURL];
     NSData * data = [NSData dataWithContentsOfURL:url];
  
     json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:nil];
  
  
  
     imgevery =[[NSMutableArray alloc]init];
  
  for (int i=0; i&lt;json.count; i++) {
  
      NSString * dd = [[json objectAtIndex:i]objectForKey:@"imgp"];
      NSString * plae =[[json objectAtIndex:i]objectForKey:@"disp"];
      image *myimg =[[image alloc]initWithimg:dd anddesp:plae];
  
      [imgevery addObject:myimg];
  
   }
  
    [self.mytableview reloadData];
  
  }
  </code></pre>
  
  <p>this is the code i have used for the tableview cell</p>
  
  <pre><code>-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  
     return 1;
  }
  -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
  return imgevery.count;
  }
  
  -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
    static NSString *cellIdentifier =@"Cell";
  
  imgpoliticalCell *cell =(imgpoliticalCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
  if (cell== nil) {
  
  
      cell = [[imgpoliticalCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
  }
  [cell setDataSource:[imgevery objectAtIndex:indexPath.row]];
  
   // cell.thumbImageView.image = _img;
  
  
     return cell;
   }
  </code></pre>