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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:03:04+00:00 2026-05-16T22:03:04+00:00

I’m trying to fix my code but I have no idea why I’m getting

  • 0

I’m trying to fix my code but I have no idea why I’m getting these errors:

modifying layer that is being finalized - 0x11818240
2010-09-10 02:35:53.022 iPhone Monkey Curling[1606:207] modifying layer that is being finalized - 0x11818240
2010-09-10 02:35:53.023 iPhone Monkey Curling[1606:207] modifying layer that is being finalized - 0x11818240
2010-09-10 02:35:54.671 iPhone Monkey Curling[1606:207] *** -[CALayer isEqual:]: message sent to deallocated instance 0x11818240

This happens when my all_score_table scroll view has had an attempt to scroll it (Crashes immediately on scroll attempt). Here is my code which sets the scroll views:

NSMutableArray * scores_data = [[first_data componentsSeparatedByString: @"\n"] mutableCopy];
        if ([scores_data count] != 3) {
            UIAlertView *connection_alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Malformed server response." delegate:nil cancelButtonTitle:@"Close" otherButtonTitles: nil];
            [connection_alert show];
            [connection_alert release];
            return;
        }
        if([[scores_data objectAtIndex:0] isEqual:@""]){
            [scores_data replaceObjectAtIndex:0 withObject:@"No scores for today,"];
        }
        if([[scores_data objectAtIndex:1] isEqual:@""]){
            [scores_data replaceObjectAtIndex:1 withObject:@"No scores this week,"];
        }
        if([[scores_data objectAtIndex:2] isEqual:@""]){
            [scores_data replaceObjectAtIndex:2 withObject:@"No scores,"];
        }
        [scores_data replaceObjectAtIndex:0 withObject: [[scores_data objectAtIndex:0] componentsSeparatedByString: @";"]];
        [scores_data replaceObjectAtIndex:1 withObject: [[scores_data objectAtIndex:1] componentsSeparatedByString: @";"]];
        [scores_data replaceObjectAtIndex:2 withObject: [[scores_data objectAtIndex:2] componentsSeparatedByString: @";"]];
        NSLog(@"scores_data");
        if (todays_scores_table){
            //One of the tables exist so all of them must. Release them for renewal.
            [todays_scores_table release];
            [week_scores_table release];
            [all_scores_table release];
            [online_scores_pages release]; //release pages also
        }
        NSLog(@"1");
        todays_scores_table = [[UIScrollView alloc] initWithFrame:CGRectMake(10, 110, 295, 300)];
        week_scores_table = [[UIScrollView alloc] initWithFrame:CGRectMake(330, 110, 295, 300)];
        all_scores_table = [[UIScrollView alloc] initWithFrame:CGRectMake(650, 110, 295, 300)];
        todays_scores_table.contentSize = CGSizeMake(205, 60 + 40*[[scores_data objectAtIndex:0] count]);
        week_scores_table.contentSize = CGSizeMake(205, 60 + 40*[[scores_data objectAtIndex:1] count]);
        all_scores_table.contentSize = CGSizeMake(205, 60 + 40*[[scores_data objectAtIndex:2] count]);
        NSLog(@"2");
        NSArray * score_data;
        NSString * path = [[NSBundle mainBundle] pathForResource: @"single_score_image" ofType:@"png"];
        NSData * data = [[NSData alloc] initWithContentsOfFile:path];
        UIImage * background_image = [[UIImage alloc] initWithData:data];
        UIImageView * background_view;
        UIImage * header_image;
        if(submission){
            path = [[NSBundle mainBundle] pathForResource: @"scores_header" ofType:@"png"];
            [data release];
            NSLog(@"3");
            data = [[NSData alloc] initWithContentsOfFile:path];
            header_image = [[UIImage alloc] initWithData:data];
        }
        UIImageView * header_view;
        int offset;
        UILabel * label;
        NSLog(@"4");
        UIScrollView * tables[3] = {todays_scores_table,week_scores_table,all_scores_table};
        online_scores_pages = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 420)];
        online_scores_pages.contentSize = CGSizeMake(960, 420);
        online_scores_pages.pagingEnabled = YES; //Act like iphone home page
        UIImage * title_image;
        UIImageView * title_view;
        NSLog(@"5");
        //border for scores table
        [data release];
        path = [[NSBundle mainBundle] pathForResource: @"score_table_border" ofType:@"png"];
        data = [[NSData alloc] initWithContentsOfFile:path];
        UIImage * border_image = [[[UIImage alloc] initWithData:data] autorelease];
        UIImageView * score_table_border;
        for (int a = 0; a < 3; a++) {
            if(submission){ //Only do header when submitting score
                header_view = [[UIImageView alloc] initWithImage: header_image];
                header_view.frame = CGRectMake(10, 10, 275, 30);
                NSLog(@"5A");
                [tables[a] addSubview: header_view];
                [header_view release];
                label = [[UILabel alloc] initWithFrame:CGRectMake(25, 10, 245, 30)];
                label.backgroundColor = [UIColor clearColor];
                NSLog(@"5B");
                NSString * end;
                NSLog(@"5C");
                if ([[scores_data objectAtIndex:a+3] characterAtIndex:0] == '1'){
                    end = @"st";
                }else if ([[scores_data objectAtIndex:a+3] characterAtIndex:0] == '2'){
                    end = @"nd";
                }else if ([[scores_data objectAtIndex:a+3] characterAtIndex:0] == '3'){
                    end = @"rd";
                }else{
                    end = @"th";
                }
                NSArray * pos_data = [[scores_data objectAtIndex:a+3] componentsSeparatedByString: @"/"];
                label.text = [NSString stringWithFormat: @"You came %@%@ from %@ scores.",[pos_data objectAtIndex:0],end,[pos_data objectAtIndex:1]];
                [tables[a] addSubview:label];
                NSLog(@"5E");
                [label release];
                NSLog(@"6");
            }
            for (int x = 0; x < [[scores_data objectAtIndex:a] count]; x++){
                score_data = [[[scores_data objectAtIndex:a] objectAtIndex:x] componentsSeparatedByString: @","];
                //Image for each score
                offset = 50 + 40*x;
                background_view = [[UIImageView alloc] initWithImage: background_image];
                background_view.frame = CGRectMake(10, offset, 275, 30); //Reposition
                [tables[a] addSubview: background_view];
                [background_view release];
                //Add score position
                label = [[UILabel alloc] initWithFrame:CGRectMake(10, offset, 30, 30)];
                label.backgroundColor = [UIColor clearColor];
                label.text = [NSString stringWithFormat: @"%i",x+1];
                label.textAlignment = UITextAlignmentCenter;
                [tables[a] addSubview:label];
                [label release];
                NSLog(@"7 %@ \n\n %@",score_data,scores_data);
                //Add name
                label = [[UILabel alloc] initWithFrame:CGRectMake(55, offset, 190, 30)];
                label.backgroundColor = [UIColor clearColor];
                label.text = [score_data objectAtIndex:0];
                [tables[a] addSubview:label];
                [label release];
                //Add score
                label = [[UILabel alloc] initWithFrame:CGRectMake(55, offset, 225, 30)];
                label.backgroundColor = [UIColor clearColor];
                label.text = [NSString stringWithFormat: @"%@",[score_data objectAtIndex:1]];
                label.textAlignment = UITextAlignmentRight;
                [tables[a] addSubview:label];
                [label release];
                NSLog(@"8");
            }
            //Add title
            switch (a) {
                case 0:
                    path = [[NSBundle mainBundle] pathForResource: @"todays_scores_title" ofType:@"png"];
                    break;
                case 1:
                    path = [[NSBundle mainBundle] pathForResource: @"week_scores_title" ofType:@"png"];
                    break;
                case 2:
                    path = [[NSBundle mainBundle] pathForResource: @"all_scores_title" ofType:@"png"];
                    break;
            }
            [data release];
            data = [[NSData alloc] initWithContentsOfFile:path];
            title_image = [[[UIImage alloc] initWithData:data] autorelease];
            title_view = [[[UIImageView alloc] initWithImage: title_image] autorelease];
            title_view.frame = CGRectMake(25 + 320*a, 15, 270, 75); //Reposition and resize
            [online_scores_pages addSubview:title_view];
            NSLog(@"9");
            //Add table
            score_table_border = [[UIImageView alloc] initWithImage: border_image];
            score_table_border.frame = CGRectMake(320*a, 100, 320, 320); //Reposition
            [online_scores_pages addSubview: tables[a]];
            [online_scores_pages addSubview: score_table_border];
            [score_table_border release];
        }
        [data release];
        if(submission){
            [header_image release];
            [header_view release];
        }
        [background_image release];
        [background_view release];
        [self addSubview: online_scores_pages];
        [online_scores_pages becomeFirstResponder];

Thank you for any help. It is much 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-05-16T22:03:05+00:00Added an answer on May 16, 2026 at 10:03 pm

    Finally! I found the problem.

    I had this call – [background_view release]; once to many. I remove it at the end as it was being released when necessary in the for loop.

    Now it works!!!!

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

Sidebar

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.