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

  • Home
  • SEARCH
  • 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 6536137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:27:19+00:00 2026-05-25T10:27:19+00:00

My app is crashing with the message modifying layer that is being finalized after

  • 0

My app is crashing with the message “modifying layer that is being finalized” after scrolling through the tableview.

I believe the error is due to the fact that I released ‘videoView’ (second last line of code) at the end of the method.

How can I resolve this issue?

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString* PlaceholderCellIdentifier = @"PlaceholderCell";

    GenericObject *youTubeVid = [self.searchResultArray objectAtIndex:indexPath.row];

    UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:PlaceholderCellIdentifier];
    if (cell == nil)
    {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:PlaceholderCellIdentifier]autorelease];

    }
    UIWebView *videoView = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, 104, 104)];

    NSString *cellid=[NSString stringWithFormat:@"Cell%i%i", indexPath.section, indexPath.row];

    if([self.webViewCache objectForKey:cellid])
    {
        videoView=[self.webViewCache objectForKey:cellid];
    }
    else
    {
        NSString *url = [NSString stringWithFormat:@"http://www.youtube.com/watch?v=%@",youTubeVid.vid];
        NSString *videoHTML = [self embedYouTube:url frame:CGRectMake(0, 0, 104, 104)];
        [videoView loadHTMLString:videoHTML baseURL:nil];
        [self.webViewCache setObject:videoView forKey:cellid]; //Save webview in dictionary
    }

    [cell.contentView addSubview:videoView];

    //Error seems to be here
    [videoView release];

    return cell;
}
  • 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-05-25T10:27:20+00:00Added an answer on May 25, 2026 at 10:27 am

    The error is because of the line,

    if([self.webViewCache objectForKey:cellid])
    {
        videoView=[self.webViewCache objectForKey:cellid];
    }
    

    Here you are just getting the web view from a dictionary, which obviously returns an autoreleased object. So, when you try to release it (without knowing whether it has been allocated or just got from dictionary) the error occurs.

    One solution would be to retain the videoView.

    videoView=[[self.webViewCache objectForKey:cellid] retain];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My app is crashing on 3.1.3 because of this NSConcreteBlock error. I read the
My 'game' keeps crashing after I resume it. Basically, I launch the app and
My app is crashing with the following message in the Xcode debugger: Watchdog has
Options: 1) When there is bad input, the app crashes and prints a message
My app is crashing when I try to post images in an HTTP request.
I recently had an app rejected for crashing on launch on an iPhone 5
My server keeps crashing. It is especially bad in localized parts of my app
In my app when I am switching views, after about the 4th time I
Ok I understand that this error mostly comes from sending a method call or
we have an iPad app crashing without. However it is a universal app using

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.