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 9287913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:47:37+00:00 2026-06-18T19:47:37+00:00

I have scroll view with 60 UIImageView’s . Images displaying in these imageviews are

  • 0

I have scroll view with 60 UIImageView's. Images displaying in these imageviews are from url and url’s i get from the webservice. When user scrolls to bottom I call the webservice and get new 60 urls. After getting the url i am utilizing same UIImageView's to display images. Following is my code for displaying images.

for (UIView *viewSel in [scrlView subviews]) {
    NSString *strImgUrl = [arrImgURL valueForKey:@"url"];
    if ([viewSel isKindOfClass:[UIImageView class]]) {

            UIImageView *imgView = (UIImageView *)viewSel;

            [imgView setImage:[UIImage imageNamed:@"loading432x520.png"]];

            NSMutableArray *arr = [[NSMutableArray alloc] init];

            [arr addObject:[NSString stringWithFormat:@"%@",strImgUrl]];

            [arr addObject:imgView];
            [self performSelectorInBackground:@selector(loadImageInBackground:) withObject:arr];

            [arr release];
    }
}


- (void) loadImageInBackground:(NSMutableArray *)arr  {

    NSLog(@"loadImage");
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    NSData *imgData = [NSData dataWithContentsOfURL:[NSURL URLWithString:[arr objectAtIndex:0]]];
    UIImage *img    = [[UIImage alloc] initWithData:imgData];
    if (img != nil) {
        [arr addObject:img];
    }
    else{
        [arr addObject:[UIImage imageNamed:@"no-image432x520.png"]];
    }
    [img release];
    [self performSelectorOnMainThread:@selector(assignImageToImageView:) withObject:arr waitUntilDone:YES];
    [pool release];
}
- (void) assignImageToImageView:(NSMutableArray *)arr{
    NSLog(@"assignImage");
    UIImageView *imgView = [arr objectAtIndex:1];
    imgView.image = [arr objectAtIndex:2];
}

The code works perfect for first time. But when i get new urls it is working some time or getting crash. I don’t know why it is getting crash. I want to stop that crash. If you are not getting to my question then let me know. Please help me for this. Thanks in advance. Valid answer will be appreciated.

  • 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-18T19:47:39+00:00Added an answer on June 18, 2026 at 7:47 pm

    Thank you all to give your help full comments to my question. I got the error. I am adding CALayer to uiimageview when allocating memory to uiimageview. I remove that CALayer code and it work perfectly. Nikita’s comment help me to find my error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a scroll view with multiple images and i am using this code.
I have a UIImageView inside of a UIScrollView. The parent scroll view allows zooming
i am using a scroll view and that scroll view i have UIIMageview and
i have to set some objects like UILabel and UIImageView in my scroll view
i have a scroll view in my application and i want that when the
I have an scroll view with some sophisticated animations happening during scrolling. Although after
I have a scroll view with transparent background that covers most of the screen.
Suppose I have a scroll view in a view & a scroll view's size
In my app I have a scroll view and four table views. Each time
I have a paged scroll view in my app and it works almost perfectly...

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.