Guest User

Untitled

a guest
Jan 20th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. - (CustomeCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  2.  
  3. CustomeCell * cell = [tableView dequeueReusableCellWithIdentifier:@"rssItemCell"];
  4. if(nil == cell){
  5. cell = [[[CustomeCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"rssItemCell"]autorelease];
  6. }
  7. cell.lblStoreName.text = [[[[self rssParser]rssItems]objectAtIndex:indexPath.row]title];
  8. cell.lblStoreDetail.text = [[[[self rssParser]rssItems]objectAtIndex:indexPath.row]description];
  9.  
  10.  
  11. NSLog(@"%@",[[self rssParser]rssItems]);
  12.  
  13. //cell.imgStore.image = [[[[self rssParser]rssItems]objectAtIndex:indexPath.row]mediaUrl];
  14.  
  15.  
  16. cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
  17.  
  18.  
  19.  
  20. NSString * mediaUrl = [[[self appDelegate]currentlySelectedBlogItem]mediaUrl];
  21. if(nil != mediaUrl){
  22. NSData* imageData;
  23. [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
  24. @try {
  25. imageData = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:mediaUrl]];
  26. }
  27. @catch (NSException * e) {
  28. //Some error while downloading data
  29. }
  30. @finally {
  31. UIImage * imageFromImageData = [[UIImage alloc] initWithData:imageData];
  32. //[[self image]setImage:imageFromImageData];
  33.  
  34. cell.imgStore.image = imageFromImageData;
  35.  
  36. [imageData release];
  37. [imageFromImageData release];
  38. }
  39. [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
  40. }
  41.  
  42.  
  43. return cell;
  44.  
  45. }
Add Comment
Please, Sign In to add comment