0

i m parsing json data and populating the tableview and making some validation with the incoming json data..everthing works fine.i made the code such that when the last table view row is clicked it got to open a modal view controller.when clicked .i m getting this error [tableiew1] Unrecognised selector send at the instance...could u guys help me out below is the code.

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.


if (indexPath.row == 5) {

    if (self.dvController6 == nil) 
    {
        Vad_tycker *temp = [[Vad_tycker alloc] initWithNibName:@"Vad_tycker" bundle:[NSBundle mainBundle]];
        self.dvController6 = temp;
        [temp release];
    }

    [self presentModalViewController:self.dvController6 animated:YES];


}

   }

enter image description here

kingston
  • 1,553
  • 4
  • 22
  • 42
  • Could you add the exact error log from console. – Rahul Sharma Feb 17 '12 at 04:56
  • Can u please tell me the complete error Message. What is that unrecognized selector given by the Debugger ? – Shah Feb 17 '12 at 04:56
  • Do u get the error on the last cell or any other cell which you press ? – Jhaliya - Praveen Sharma Feb 17 '12 at 05:05
  • You sure you have Import The Vad_tycker.h File in this View COntroller? – Shah Feb 17 '12 at 05:11
  • The exception is probably not happening in that code, since that code doesn't mention `tableView1`. You need to get a stack trace of the exception. [Create an exception breakpoint](http://stackoverflow.com/questions/4961770/run-stop-on-objective-c-exception-in-xcode-4), then run it again. Edit your question and paste in the stack trace. – rob mayoff Feb 17 '12 at 05:12
  • Is self a view controller or a standalone tableview? – sosborn Feb 17 '12 at 05:13
  • Does Vad_tycker have tableView1 instance ? – Jhaliya - Praveen Sharma Feb 17 '12 at 05:16
  • @sosborn:in a view controller i ve set tableview.. – kingston Feb 17 '12 at 05:17
  • @jhaliya:nope....Vad_tycker du is a new view controller.i m trying to call the view using a modal view controller. – kingston Feb 17 '12 at 05:18
  • @kingston: Do you have a TableView on Vad_tycker Controller as well ?? – Shah Feb 17 '12 at 05:21
  • I Guess. on your Vad_tycker, You have forgotten to add the Delegate and Datasource methods of tableView. Check it and tell me. you have those in that controller and also they are connected?? – Shah Feb 17 '12 at 05:25
  • Also make it sure you have connected your TableView IBoutlet with the tableView on the vad_tycker View. – Shah Feb 17 '12 at 05:26
  • yup its working ...In vadtycker du ive used the same variavle tableview1 to connect to the tableview...dats where the problem is . – kingston Feb 17 '12 at 05:29

2 Answers2

1

Seems like you have forgotten to provide the access for the tableView1 in Vad_tycker. Or You should do a crosscheck whether you have assigned the correct instance in tableView delegate's and also make sure to provide the implementation for the method of delegate's in their respect target classes.

Jhaliya - Praveen Sharma
  • 31,697
  • 9
  • 72
  • 76
  • sorry this is not only for last row of tableview but for any rows it may appear.i have even set the datasource and delegate for the tableview – kingston Feb 17 '12 at 05:12
  • Vad_tycker du is a sepearte view controller...could u help me to provide the acess – kingston Feb 17 '12 at 05:21
  • @kingston: OK, Just like to know do you get the control in didSelectRowAtIndexPath: method ? if yes .. which line of didSelectRowAtIndexPath: method cause the crash ? – Jhaliya - Praveen Sharma Feb 17 '12 at 05:23
  • yes i do ..dats the reason my app is sending error when last tableview row is cllicked – kingston Feb 17 '12 at 05:25
1

I think you forgot to connect the tableView Datasource and Delegate methods in the vad_tycker controller.

Also check that the instance of UITableView i.e. in your case tableView1 is also connected with the TableView. on the view.

Thanks

Shah
  • 4,990
  • 10
  • 48
  • 70