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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T07:17:17+00:00 2026-05-21T07:17:17+00:00

i am getting problem with this can any one help me here is my

  • 0

i am getting problem with this can any one help me
here is my code. This code work 1st click but when click 2 time it get error

malloc: error for object 0x4e226a4: incorrect checksum for freed object – object was probably modified after being freed.
*
* set a breakpoint in malloc_error_break to de**bug

- (void)updateTextViewContents {
    content = [[NSMutableString alloc] init];   
    for (int i = 0; i <[ _scoresArray count]; i++)
    {
    NSMutableString *data = [_scoresArray objectAtIndex:i];
        [content appendString:data];
        if([content isEqualToString:UserText.text]&&[content isEqualToString:PassText.text])
        {
        UIAlertView *alt = [[UIAlertView alloc] initWithTitle:nil message:@"Valid User" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
            [alt show];
            [alt release];
            [content release];

        }
        else    
        {
        UIAlertView *alt1 = [[UIAlertView alloc] initWithTitle:nil message:@"NOT A Valid User" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
        [alt1 show];
        [alt1 release];
        }
    }

when i release over here it work but when i click 2nd time by entering right user name and password both alter view display at time .I think it will happen because of array get add at every cilck that’s why both alter view dispaly at time how i sovle this .
//[content release];

}

  • 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-21T07:17:18+00:00Added an answer on May 21, 2026 at 7:17 am

    Here generate memory problem because of,

    you release content NSMutableString in if condition and then append it again.

    So, Don’t release in to for loop, release it out of for loop.

    – (void)updateTextViewContents
    {

    content = [[NSMutableString alloc] init];
    
    for (int i = 0; i <[ _scoresArray count]; i++) 
    {
    
        NSMutableString *data = [_scoresArray objectAtIndex:i];
        [content appendString:data];
        if([content isEqualToString:UserText.text]&&[content isEqualToString:PassText.text])
        {
            UIAlertView *alt = [[UIAlertView alloc] initWithTitle:nil message:@"Valid User" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
            [alt show];
            [alt release];
            //[content release]; - Not release here.
    
        }
        else    
        {
            UIAlertView *alt1 = [[UIAlertView alloc] initWithTitle:nil message:@"NOT A Valid User" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
            [alt1 show];
            [alt1 release];
        }
    }
    
    [content release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a really nebulous error that I can't seem to get a lot
can anybody help with the above SourceSafe error? I've spent hours trying to find
I have had major problems with getting UserControls to work in XAML - I
I'm still getting the hang of Rails, and I've come across a problem that
Here's my high level problem. I want to read a number max_age_in_secs from a
Hey everyone. I'm really struggling to figure out the logic with this one and
I want to write a little DBQuery function in perl so I can have
I'm trying to craete a site which allows users to upload any file type
I'm trying to transform one XML format to another using XSL. Try as I
I work in the technical group at a large Architecture firm. While there are

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.