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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:43:48+00:00 2026-05-16T05:43:48+00:00

If I keep calling this method over and over and over: -(IBAction)pressedNextPage { NSUserDefaults

  • 0

If I keep calling this method over and over and over:

-(IBAction)pressedNextPage {

    NSUserDefaults *profiles = [NSUserDefaults standardUserDefaults];
    NSInteger newUser = [profiles integerForKey:@"activeuser"];

    if(newUser == 1) {
        [profiles setObject:name.text forKey:@"name1"];
        [profiles setObject:social.text forKey:@"social1"];
    } else if(newUser == 2) {
        [profiles setObject:name.text forKey:@"name2"];
        [profiles setObject:social.text forKey:@"social2"];
    } else if(newUser == 3) {
        [profiles setObject:name.text forKey:@"name3"];
        [profiles setObject:social.text forKey:@"social3"];
    }

    [profiles synchronize];

    DA31P2ViewController *da31p2Control = [[DA31P2ViewController alloc]initWithNibName:@"DA31P2ViewController" bundle:nil];
    [self.navigationController pushViewController:da31p2Control animated:YES];
    da31p2Control.release;

}

…it will eventually crash. I suspect a memory leak somewhere but can’t seem to find it. Could it be here or possibly on the view it is loading? I shouldn’t need to release profiles because I don’t alloc it, right?

  • 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-16T05:43:48+00:00Added an answer on May 16, 2026 at 5:43 am

    Hmm, I wasn’t aware that you could call release by simply doing object.release, are you sure you can do that? If not, then that would explain the crashing. Each time you call it, the view controller is not being released, so they’re just piling up, there’s your memory leak. Try changing it to [da31p2Control release].

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

Sidebar

Related Questions

I keep getting a error:undefined message when calling this AJAX method. $.ajax({ type: GET,
I am calling a method from another method and keep getting a warning: firstViewController
I'll keep this one as simple as I can. I have a method in
I keep getting this suggestion from many fellow developers over and over again. In
How do i do this in the best possible way? Unobtrusive and keep calling
(Keep in mind this is on OSX Snow Leopard) I don't know how to
Keep getting this error after inserting a subdatasheet into a query and trying to
Keep going around circles, but I am still unclear about this. Have a feeling
I keep coming back to this problem, since there doesn't seem to be a
I have a MouseListener Thread where this method is called each time there is

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.