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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:21:15+00:00 2026-05-24T04:21:15+00:00

I have an iphone application that crashes when I switch between two of the

  • 0

I have an iphone application that crashes when I switch between two of the tabs 4 or 5 times. One of the views has a UITableView that searches as you type and I have a feeling that’s where something is going wrong. In the Interface Builder if I connect the Table Views referencing outlet to the array that contains the search results the search as you type works perfectly but then I have the switching between views problem.
If I do not make this connection the search does not work right. It only refreshes the table view when I scroll up and down after searching.

Does anyone have any idea what could be going wrong? I’ve been struggling with this for days and I’m very new to iphone programming. Thank you

EDIT:
I’m getting this error in the console:

2011-07-30 10:52:09.835 ConnectIPhone[7019:207] -[NSCFString setReorderedIndexPath:]:     unrecognized selector sent to instance 0x4e48370
2011-07-30 10:52:09.838 ConnectIPhone[7019:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString setReorderedIndexPath:]:     unrecognized selector sent to instance 0x4e48370'
*** Call stack at first throw:
(
0   CoreFoundation                      0x00dd6be9 __exceptionPreprocess + 185
1   libobjc.A.dylib                     0x00f2b5c2 objc_exception_throw + 47
2   CoreFoundation                      0x00dd86fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3   CoreFoundation                      0x00d48366 ___forwarding___ + 966
4   CoreFoundation                      0x00d47f22 _CF_forwarding_prep_0 + 50
5   UIKit                               0x00359171 -[UITableView reloadData] + 446
6   ConnectIPhone                       0x0000649e -[PeopleViewController viewWillAppear:] + 460
7   UIKit                               0x003a02bf -[UITabBarController transitionFromViewController:toViewController:transition:shouldSetSelected:] + 263
8   UIKit                               0x0039ed86 -[UITabBarController transitionFromViewController:toViewController:] + 64
9   UIKit                               0x003a0b7e -[UITabBarController _setSelectedViewController:] + 263
10  UIKit                               0x003a09ed -[UITabBarController _tabBarItemClicked:] + 352
11  UIKit                               0x002dfa6e -[UIApplication sendAction:to:from:forEvent:] + 119
12  UIKit                               0x004dd1f2 -[UITabBar _sendAction:withEvent:] + 422
13  UIKit                               0x002dfa6e -[UIApplication sendAction:to:from:forEvent:] + 119
14  UIKit                               0x0036e1b5 -[UIControl sendAction:to:forEvent:] + 67
15  UIKit                               0x00370647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
16  UIKit                               0x0036e16c -[UIControl sendActionsForControlEvents:] + 49
17  UIKit                               0x002dfa6e -[UIApplication sendAction:to:from:forEvent:] + 119
18  UIKit                               0x0036e1b5 -[UIControl sendAction:to:forEvent:] + 67
19  UIKit                               0x00370647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
20  UIKit                               0x0036f1f4 -[UIControl touchesEnded:withEvent:] + 458
21  UIKit                               0x003040d1 -[UIWindow _sendTouchesForEvent:] + 567
22  UIKit                               0x002e537a -[UIApplication sendEvent:] + 447
23  UIKit                               0x002ea732 _UIApplicationHandleEvent + 7576
24  GraphicsServices                    0x0170ca36 PurpleEventCallback + 1550
25  CoreFoundation                      0x00db8064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
26  CoreFoundation                      0x00d186f7 __CFRunLoopDoSource1 + 215
27  CoreFoundation                      0x00d15983 __CFRunLoopRun + 979
28  CoreFoundation                      0x00d15240 CFRunLoopRunSpecific + 208
29  CoreFoundation                      0x00d15161 CFRunLoopRunInMode + 97
30  GraphicsServices                    0x0170b268 GSEventRunModal + 217
31  GraphicsServices                    0x0170b32d GSEventRun + 115
32  UIKit                               0x002ee42e UIApplicationMain + 1160
33  ConnectIPhone                       0x00001ca0 main + 102
34  ConnectIPhone                       0x00001c31 start + 53
35  ???                                 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'

cellForRowAtIndexPath code:

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

static NSString *cellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil){
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
}
row = [indexPath row];
if (row >= [listData count]){
    cell.textLabel.text = @"";
}else {
    NSMutableString *cellText = [[NSMutableString alloc] initWithString:[[listData objectAtIndex:row] objectAtIndex:0]];
    [cellText appendString:@", "];
    [cellText appendString:[[listData objectAtIndex:row] objectAtIndex:1]];
    cell.textLabel.textColor = [UIColor whiteColor];
    cell.textLabel.text = cellText;
    [cellText release];
}
return cell;
}

The class:

#import "PeopleViewController.h"

@implementation PeopleViewController
// The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
/*
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
    // Custom initialization.
}
return self;
}
*/

-(void)loadView
{
[super loadView];
}

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
self.editing = YES;
cHandle = [ConnectHandler new];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
userID = [defaults objectForKey:kUserID];
password = [defaults objectForKey:kPassword];

NSString *response = [cHandle doSearch:@"" :userID :[cHandle hashPass:password]];
listData = (NSMutableArray*)[cHandle parseSearch:response];
self.view.autoresizesSubviews = YES;
self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth |     UIViewAutoresizingFlexibleHeight;

[listTable reloadData];

[super viewDidLoad];
}

-(void)viewWillAppear:(BOOL)animated
{
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

userID = [defaults objectForKey:kUserID];
password = [defaults objectForKey:kPassword];

//initiate the connection handler, get the json response
cHandle = [ConnectHandler new];
NSString *response = [cHandle doSearch:@"": userID :[cHandle hashPass:password]];
listData = (NSMutableArray*)[cHandle parseSearch:response];
//[listTable reloadData];
[response release];
[super viewWillAppear:animated];
}

-(void)viewWillDisappear:(BOOL)animated{
[listData release];
[listTable release];

[super viewWillDisappear:animated];
}

// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations.
return YES;
}


- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];

// Release any cached data, images, etc. that aren't in use.
}

- (void)viewDidUnload {
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}


#pragma mark -
#pragma mark Search View
-(void)searchBarSearchButtonClicked:(UISearchBar *)searchBar{
listData = nil;
[listTable reloadData];
query = searchBar.text;
[searchBar resignFirstResponder];

[listData removeAllObjects];
}

-(void)searchBarCancelButtonClicked:(UISearchBar *)searchBar {
searchBar.text = @"";
[listTable reloadData];
[searchBar resignFirstResponder];
query = searchBar.text;

[listData removeAllObjects];
[self loadSearch:query];
}

-(void)searchBar:(UISearchBar*)searchBar textDidChange:(NSString*)searchText {
listData = nil;
[listTable reloadData];
query = searchBar.text;
[listData removeAllObjects];
[self loadSearch:query];
}

-(void)searchBarTextDidEndEditing:(UISearchBar *)searchBar
{
[listTable reloadData];
}

-(void)loadSearch:(NSString *)q{
self.editing = YES;
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];

userID = [defaults objectForKey:kUserID];
password = [defaults objectForKey:kPassword];

NSString *response = [cHandle doSearch:q :userID :[cHandle hashPass:password]];
listData = (NSMutableArray*)[cHandle parseSearch:response];
[listTable reloadData];
for (UITableViewCell *cell in [listTable visibleCells]) {
    NSIndexPath *cellIndexPath = [listTable indexPathForCell:cell];

    [listTable cellForRowAtIndexPath:cellIndexPath];
}
[response release];
}

- (void)dealloc {
[listData release];
[cHandle release];
[super dealloc];
}

#pragma mark -
#pragma mark Table View Data Source Methods
-(NSInteger)numberOfSectionsInTableView:(UITableView*)tableView 
{
return 1;
}

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

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

static NSString *cellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil){
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
}
row = [indexPath row];
if (row >= [listData count]){
    cell.textLabel.text = @"";
}else {
    NSMutableString *cellText = [[NSMutableString alloc] initWithString:[[listData objectAtIndex:row] objectAtIndex:0]];
    [cellText appendString:@", "];
    [cellText appendString:[[listData objectAtIndex:row] objectAtIndex:1]];
    cell.textLabel.textColor = [UIColor whiteColor];
    cell.textLabel.text = cellText;
    [cellText release];
}
return cell;
}


-(UITableViewCellEditingStyle)tableView:(UITableView*)tableView editingStyleForRowAtIndexPath:(NSIndexPath*)indexPath
{
if (self.editing && indexPath.row == ([listData count]))
    return UITableViewCellEditingStyleInsert;
else {
    return UITableViewCellEditingStyleDelete;
}
}


-(void)tableView:(UITableView*)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath*)indexPath {
[listTable beginUpdates];
if (editingStyle == UITableViewCellEditingStyleDelete)
{
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    [cell setUserInteractionEnabled:NO];
    cell.selected = NO;
    [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else {

}
[listTable endUpdates];
}

-(BOOL)tableView:(UITableView*)tableView canMoveRowAtIndexPath:(NSIndexPath*)indexPath
{
return YES;
}


@end
  • 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-24T04:21:16+00:00Added an answer on May 24, 2026 at 4:21 am

    It seems in your code a method is called on string instead of something else. Try to debug your application put a breakpoint in cellForRowAtIndexPath.

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

Sidebar

Related Questions

I have an iPhone application that has a user preference page where the user
I have an iPhone application with a settings.bundle that handles various settings for my
I have an application that works some what similar to how iPhone's Contact application
I have two projects, a Cocoa iPhone application and a static library which it
I have a Cocos2D iPhone application that requires a set of CGRects overlaid on
I have an iPhone application which has some methods to gather information from the
I have found a crash in an iPhone application with target iOS 4 that
I currently have an iPhone application that makes a call to an API to
I have a View based application for iPhone/iPod that plays audio, having a VU
We are developing an application that has an iPhone client, and a Rails server.

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.