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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:08:10+00:00 2026-05-15T21:08:10+00:00

Updates code – (void) searchBarSearchButtonClicked:(UISearchBar *)theSearchBar { mytimer3=[NSTimer scheduledTimerWithTimeInterval:.03 target:self selector:@selector(show) userInfo:nil repeats:NO]; NSLog(@

  • 0

Updates code

- (void) searchBarSearchButtonClicked:(UISearchBar *)theSearchBar {
    mytimer3=[NSTimer scheduledTimerWithTimeInterval:.03 target:self selector:@selector(show) userInfo:nil repeats:NO];


        NSLog(@" search is down");  



    //////////// rnd to hold keyboard





     //ovController.view.backgroundColor = [UIColor grayColor];


     self.tableView.scrollEnabled = NO;




     UserText=[self.searchDisplayController.searchBar text];
     myInt= UserText.length;
     //int myInt= [save length];



    // NSString *myStringPrt1 = [[NSString alloc] init];
    // NSString *myStringPrt2 = [[NSString alloc] init];


     if(UserText.length>3)

     {
     //[ovController.view removeFromSuperview];
     //[tableView reloadData];
     url=nil;
    // myStringPrt1=@"http://find.php?keyword=";
    NSString * myStringPrt2=UserText;
    // myStringPrt1=[myStringPrt1 stringByAppendingString:myStringPrt2];
    // myStringPrt1 = [myStringPrt1 stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

    // loadingView.hidden=NO;




         NSString *outputString = [[NSString stringWithString:@"http://find.php?keyword="] stringByAppendingString: UserText];
         outputString = [outputString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];


         NSLog(@"My string is  now =  %@", outputString);


     url=   [NSURL URLWithString:outputString];



     NSXMLParser *xmlParser = [[[NSXMLParser alloc] initWithContentsOfURL:url] autorelease];

     //Initialize the delegate.
     XMLParser *parser = [[[XMLParser alloc] initXMLParser]autorelease];

     //Set delegate
     [xmlParser setDelegate:parser];

     //Start parsing the XML file.
     BOOL success = [xmlParser parse];
     if(success)
     {



         [super viewDidLoad];




     [self searchTableView];    
         mytimer4=[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(wipe) userInfo:nil repeats:NO];
     }


     }

}

  • 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-15T21:08:11+00:00Added an answer on May 15, 2026 at 9:08 pm

    Right, you have memory leaks all over the place:

    NSString *myStringPrt1 = [[NSString alloc] init];
    NSString *myStringPrt2 = [[NSString alloc] init];
    
    url=nil;
    
    myStringPrt1=@"http://wap?keyword="; //MEMORY LEAK, this will assign a new string to myStringPrt1, without releasing the first one
    myStringPrt2=UserText; //MEMORY LEAK, this will assign a new string to myStringPrt2, without releasing the first one
    
    myStringPrt1=[myStringPrt1 stringByAppendingString:myStringPrt2]; //MEMORY LEAK, this will assing an autoreleased string the myStringPrt1, without releasing the old one first.
    myStringPrt1 = [myStringPrt1 stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; //MEMORY LEAK, this will assing an autoreleased string the myStringPrt1, without releasing the old one first.
    

    I suggest you first read the memory management guidelines as indicated by Kubi. Or, if you are feeling lazy, use this:

    NSString *outputString = [[NSString stringWithString:@"http://wap?keyword="] stringByAppendingString: UserText];
    outputString = [outputString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    

    Or this:

    NSString *outputString = [NSString stringWithFormat:@"http://wap?keyword=%@",UserText];
    outputString = [outputString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I typically run a script each night that updates my code from SVN, then
I have this function in my Javascript Code that updates html fields with their
I wrote a batch script which recursively updates my source code against the company's
For my area, I get the updates from ww.asp.net code.google.com www.webmasterworld.com What others do
Looking through some code I came across the following code trTuDocPackTypdBd.update(TrTuDocPackTypeDto.class.cast(packDto)); and I'd like
Update: This turned into a blog post, with updated links and code, over at
Update: Solved, with code I got it working, see my answer below for the
I have code in an Update Panel and even though on a button click
Replaces Question: Update multiple rows into SQL table Here's a Code Snippet to update
I've been asked to implement some code that will update a row in a

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.