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

  • SEARCH
  • Home
  • 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 7401485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:28:53+00:00 2026-05-29T04:28:53+00:00

In my app i have a text field where if i enter a word

  • 0

In my app i have a text field where if i enter a word i should get all the file names starting with the particular word into a UITable. Here i am getting these file names into an array and its available in NSLog too… But the table remains empty always. Control is not entering into table(NSLog in tables method is not getting displayed). Can anyone help me?
my code is

-(IBAction)Do_Search:(id)sender
{ 
 files = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:
         [[NSBundle mainBundle] bundlePath] error:nil];
search_results_array = [files filteredArrayUsingPredicate:
                        [NSPredicate predicateWithFormat:@"self BEGINSWITH[cd] 'h'"]];
NSLog(@"%@", search_results_array);
int search_res_count=[search_results_array count];
NSLog(@"Array has %d results...",search_res_count);
[Result_table reloadData];
}

here i couldn’t implement the search as i desired. Instead i tried to list all file names starting with “h”.

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section          {
    return [search_results_array count];

}

// Customize the appearance of table view cells.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
 {

static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}

// Set up the cell...
NSString *Lyrics_found= [search_results_array objectAtIndex:indexPath.row];
cell.textLabel.text=Lyrics_found;
NSLog(@"%@",search_results_array);
return cell;
}

when [Result_table reloadData]; is given program gets exited and when removes it the table remains empty.

  • 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-29T04:28:54+00:00Added an answer on May 29, 2026 at 4:28 am

    Retain search_results_array before [Result_table reloadData];.

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

Sidebar

Related Questions

I have an app that reads a huge text file (about more than 100MB)
I have a app/helpers/application_helper.rb file with this code: def clippy(text, bgcolor = #ffffff) text.gsub!('',')
I have a small Silverlight app which downloads all of the images and text
In my Rails 3 web app, I have a Twitter text field in one
I have an app that allows users to enter a project into a database.
I have a text field in my app, and a button to open the
I'm making an asp.net app using visual studio 2010. I have a text field
in my app I have some text.setTextColor(Color.GRAY) . Now I would like to use
I have an text reader app that is designed to receive intent from Android
I'm working on an ASP.NET/C# app. I have 2 text boxes and I need

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.