Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8277259
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:38:20+00:00 2026-06-08T08:38:20+00:00

I am showing data in a UITableView with a thumbnail image. Initially, when the

  • 0

I am showing data in a UITableView with a thumbnail image. Initially, when the cell is clicked on, I would reload the image from the server which would take additional time, resources, and memory. Instead of doing this, I thought of passing a pointer of the thumbnail image to the view that will be on screen and display it immediately, instead of having to redownload it. However, I am running into a problem – nothing loads when I set the imageView on the new view to the old image. Here is my code:

This is in my UITableView Class:

CustomCell *cell = (CustomCell *)[tableView cellForRowAtIndexPath:indexPath];
NewsViewController *newsViewController = [[NewsViewController alloc] initWithNibName:@"NewsViewController" bundle:nil dictionary: dict type:d numberOfPages:1 image: cell.imageView.image];

NewsViewController.m:

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil dictionary:(NSDictionary *)dict type:(NSInteger)type numberOfPages:(NSInteger)pages image:(UIImage *)image{
    self = [super initWithNibName:@"NewsViewController" bundle:Nil];
    if (self) {

        newsText = [dict objectForKey:@"content"];
        newsTitle = [dict objectForKey:@"title"];
        newsDate = [dict objectForKey:@"pub_date"];
        d = type;
        numberOfPages = pages;
        imageURL = [[NSMutableArray alloc] initWithCapacity:numberOfPages];
        mainImage = [[UIImage alloc] init];
        mainImage = image;
   }
   return self; 
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    labelBody.text= newsText;
    titleView.text = newsTitle;
    date.text = newsDate;
    if (numberOfPages == 1) {
        imageScrollView.contentSize = CGSizeMake(320, 303);
        pageControl.numberOfPages = 1;
        CustomImageView *customImageView  = [[CustomImageView alloc] initWithFrame:imageScrollView.bounds];
        [imageScrollView addSubview:customImageView];
        customImageView.imageView.image = mainImage;
    }
}

NewsViewController.h

#import <UIKit/UIKit.h>
#import "AdWhirlView.h"
#import "AdWhirlDelegateProtocol.h"

@class Reachability;

@interface NewsViewController : UIViewController<AdWhirlDelegate, UIScrollViewDelegate>{
    AdWhirlView *adView;
    IBOutlet UILabel *labelBody;
    IBOutlet UILabel *titleView;
    IBOutlet UILabel *subTitle;
    IBOutlet UILabel *date;
    IBOutlet UIScrollView *scrollView;
    IBOutlet UIScrollView *imageScrollView;
    IBOutlet UIImageView *backgroundImage;
    IBOutlet UIImage *mainImage;
    IBOutlet UIPageControl *pageControl;
    NSInteger numberOfPages;
    NSMutableArray *imageURL;

}

@property(nonatomic,retain)AdWhirlView *adView;
@property (nonatomic, retain) NSMutableArray *imageURL;  
@property (nonatomic, retain) IBOutlet UIPageControl *pageControl;
@property (nonatomic, retain) IBOutlet UIScrollView *imageScrollView;
@property (nonatomic, weak) IBOutlet UIImageView *backgroundImage;
@property (nonatomic, retain) IBOutlet UIImageView *imageView;
@property (nonatomic, retain) IBOutlet UIScrollView *scrollView;
@property (nonatomic, retain) IBOutlet UIImage *mainImage;
@property (nonatomic, strong) NSString *newsText;
@property (nonatomic, strong) NSString *newsTitle;
@property (nonatomic, strong) NSString *newsDate;
@property (nonatomic, assign) NSInteger numberOfPages;
@property (nonatomic, strong) IBOutlet UILabel *titleView;
@property (nonatomic, strong) IBOutlet UILabel *labelBody;
@property (nonatomic, strong) IBOutlet UILabel *subTitle;
@property (nonatomic, strong) IBOutlet UILabel *date;
@property (nonatomic, retain) Reachability* internetReachable;
@property (nonatomic, assign) BOOL internetActive;

-(void) checkNetworkStatus:(NSNotification *)notice;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil     dictionary: (NSDictionary *)dict type:(NSInteger)type numberOfPages:(NSInteger) pages image:(UIImage *)image;
- (BOOL)checkInternet;
- (void)doStuff;
- (IBAction)ad;

@end

I am using mainImage as a (UIImage *) and trying to replace the image in my customImageView class with the main Image but nothing is showing up. What am I missing here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T08:38:22+00:00Added an answer on June 8, 2026 at 8:38 am

    I guess you’d like to build some sort of caching mechanism for your UIImageView. One of the easiest ways to get all of this working is by making use of the AFNetworking library.

    AFNetworking extends UIImageView with some extra methods for loading images from remote sources. AFNetworking has caching build-in, no need to reinvent the wheel 🙂

    Take a look on the following sites:

    • AFNetworking
    • UIImageView (AFNetworking)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UITableView showing data from a plist file. For this table view,
In my google analytics account it is showing data from my local testing server.
When showing data from a mysql table on an php page does it have
Trying to scrape images and data from a website using Xpath but keeps showing
Im not sure why, but my UITableView, which isnt anything fancy, is showing repeating
I have Datagrid which is clicking by mouse in each row is showing data
I'm downloading data from the web that is then showed on a UITableView .
UITableView custom cell showing weird results? I have my code below. Everything was showing
I create a List showing data from a RecordStore. I tried to update a
I am showing data from DB in an Activity. I want a Table and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.