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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:26:37+00:00 2026-05-26T02:26:37+00:00

Update I turned Zombies on… and got this error: *** -[CALayer retain]: message sent

  • 0

Update

I turned Zombies on… and got this error:

*** -[CALayer retain]: message sent to deallocated instance 0x709d1a0

I’m experiencing a crash that does not make any sense to me. In loadMediaList I’m programmatically creating multiple buttons and assigning an action(openMedia:) to them. That action has an “openURL” action. Everything works great, until the action is called; the action is performed, opened up in a new window, but then crashes once the app is exited. I replaced the “openURL” code with different code, and it still crashes… thoughts?

There is no error in the console, I get EXC_BAD_ACCESS. The console says:

sharedlibrary apply-load-rules all
Current language: auto; currently objective-c
kill
quit
Program ended with exit code: 0

I have been working on this issue for a few days now and I cannot figure it out. my dealloc is great, threads seem to be working well, etc. I don’t know if this is legal on Stack Overflow, but I will gladly pay someone to help me solve this. I have a very tight deadline.

Hope you can help!

-(IBAction)showMedia:(id)sender {
    NSLog(@"Media Button was pressed");

    //Begin Alert
    [SVProgressHUD showInView:self.view status:@"Loading..."];

    mediaScroll.delegate = self;
    mediaScroll.frame = CGRectMake(15, 60, 240, 185);
    mediaScroll.clipsToBounds = YES;

    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.4];

    statsBTN.frame = CGRectMake(272, 76, 48, 46);
    donateBTN.frame = CGRectMake(272, 124, 48, 46);
    shareBTN.frame = CGRectMake(272, 172, 48, 46);
    mediaBTN.frame = CGRectMake(280, 220, 48, 46);

    incViewPopUP.alpha = 0;
    donViewPopUP.alpha = 0;
    shareViewPopUP.alpha = 0;
    mediaViewPopUP.alpha = 1;

    [UIView commitAnimations];

    [self loadMediaList];

    [mediaBTN addTarget:self action:@selector(closePopUp:) forControlEvents:UIControlEventTouchUpInside];
    }


-(void)loadMediaList {
[self.productPointers removeAllObjects];

    NSSortDescriptor *sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"date_reported" ascending:NO] autorelease];
    NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
    NSArray *sortedArray = [finalMediaList sortedArrayUsingDescriptors:sortDescriptors];
    NSLog(@"Sorted Media Array: %@", sortedArray);

    if (mediaLoaded == NO) {

        NSDictionary *mediaPost;
        for (mediaPost in sortedArray) {

            NSDictionary *inside = (NSDictionary *)[mediaPost valueForKey:@"media"];
            NSLog(@"Inside Array: %@", inside);

            UIButton *mediaView = [[UIButton buttonWithType:UIButtonTypeCustom] retain];
            mediaView.frame = CGRectMake(0, (mx * 100), 225, 100);
            mediaView.backgroundColor = [UIColor clearColor];
            [mediaView addTarget:self action:@selector(openMedia:) forControlEvents:UIControlEventTouchUpInside];
            mediaView.titleLabel.hidden = YES;
            mediaView.titleLabel.alpha = 0;

            mx++; NSLog(@"MX: %i", mx);


            UILabel *mediaDesc = [[UILabel alloc] init];
            mediaDesc.frame = CGRectMake(50, 20, 154, 40);
            mediaDesc.backgroundColor = [UIColor clearColor];
            mediaDesc.font = [UIFont fontWithName:@"Geogrotesque" size:12];
            mediaDesc.textColor = UIColorFromRGB(0xc7c7c7);
            mediaDesc.numberOfLines = 0;
            mediaDesc.lineBreakMode = UILineBreakModeWordWrap;
            mediaDesc.text = [inside valueForKey:@"description"];

            UILabel *mediaType = [[UILabel alloc] init];
            mediaType.frame = CGRectMake(50, 40, 154, 50);
            mediaType.backgroundColor = [UIColor clearColor];
            mediaType.font = [UIFont fontWithName:@"Geogrotesque" size:12];
            mediaType.textColor = UIColorFromRGB(0xffffff);
            mediaType.numberOfLines = 0;
            mediaType.lineBreakMode = UILineBreakModeWordWrap;
            mediaType.text = [[inside valueForKey:@"type"] uppercaseString];


            UIImageView *mediaBorder = [[UIImageView alloc] initWithFrame:CGRectMake(0, 99.0, 220.0, 1.0)];
            [mediaBorder setImage:[UIImage imageNamed:@"bottom_border.png"]];

            UIImageView *mediaArrow = [[UIImageView alloc] initWithFrame:CGRectMake(214.0, 45.0, 6.0, 9.0)];
            [mediaArrow setImage:[UIImage imageNamed:@"media_right_arrow.png"]];


            if ([mediaType.text isEqualToString:@"VIDEO"]) {
                UIImageView *mediaThumb = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 35.0, 30.0, 30.0)] autorelease];
                [mediaThumb setImage:[UIImage imageNamed:@"media_play_icon.png"]];
                [mediaView addSubview:mediaThumb];
                [mediaThumb release];

                [mediaView setTag:1];
                [mediaView setTitle:[inside valueForKey:@"filename"] forState:UIControlStateNormal];
                }

            if ([mediaType.text isEqualToString:@"IMAGE"]) {
                UIImageView *mediaThumb = [[[UIImageView alloc] initWithFrame:CGRectMake(0, 35.0, 30.0, 22.0)] autorelease];
                [mediaThumb setImage:[UIImage imageNamed:@"media_photo_icon.png"]];
                [mediaView addSubview:mediaThumb];
                [mediaThumb release];

                [mediaView setTag:2];
                [mediaView setTitle:[inside valueForKey:@"url"] forState:UIControlStateNormal];
                }


            [mediaView addSubview:mediaArrow];
            [mediaView addSubview:mediaBorder];
            [mediaView addSubview:mediaDesc];
            [mediaView addSubview:mediaType];
            [mediaScroll addSubview:mediaView];
            [self.productPointers addObject:mediaView];

            [mediaArrow release];
            [mediaBorder release];
            [mediaType release];
            [mediaDesc release];
            [mediaView release];
        }
    }

    mediaLoaded = YES;
    [mediaScroll setContentSize:CGSizeMake(225.0f, (mx * 100))];

    //End Alert
    [SVProgressHUD dismiss];
    }


-(IBAction)openMedia:(id)sender {
    NSLog(@"Media opened!");

    NSString *tag = [NSString stringWithFormat:@"%d", [sender tag]];
    NSLog(@"Tag: %@", tag);

    videoID = [sender currentTitle];

    NSString *videoURL = [[[NSString alloc] initWithFormat:@"http://www.vimeo.com/%@", videoID] autorelease];

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:videoURL]];
    NSLog(@"Video URL: %@", videoURL);
    }
  • 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-26T02:26:38+00:00Added an answer on May 26, 2026 at 2:26 am

    Turn on malloc stack logging, guard malloc, and zombie enabled in the debugger, then run:

    (gdb) info malloc-history 0x1b18b0
    

    Where 0x1b18b0 is the address of the thing that has the bad access error. It should give you more info about where in your code the problem is.

    See this article for better instructions


    Also, some code thoughts that may help

    change this:

    videoID = [sender currentTitle];
    NSString *videoURL = [[[NSString alloc] initWithFormat:@"http://www.vimeo.com/%@", videoID] autorelease];
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:videoURL]];
    

    To:

    videoID = [sender currentTitle];
    if (videoID) {
        // no need to alloc then set autorelease, just used a named initializer since they autorelease by default:
        NSString *videoURL = [NSString stringWithFormat:@"http://www.vimeo.com/%@", videoID];
        [[UIApplication sharedApplication] openURL:[NSURL URLWithString:videoURL]];
    } else {
        // deal
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Update: This turned into a blog post, with updated links and code, over at
UPDATE This is an old question for an old version of Xcode. It turned
UPDATE: This turned out to be a bug in R14 of the SDK tools.
Update: Solved, with code I got it working, see my answer below for the
Update: Check out this follow-up question: Gem Update on Windows - is it broken?
Update: Now that it's 2016 I'd use PowerShell for this unless there's a really
This subject turned into a heated discussion at the office, so I'm interested to
Update Ignore the following. It turned out to be a bug restricted to Macruby
Final update and fix : The solution here turned out to be a combination
Update - the problem didn't lie within the extension method As it turned out,

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.