0

I'm working on iPad app using master-detail template were the master tableview is passing data to a second tableviewController:

Currently is what I have:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
    UITableViewController *secondTableView = [segue destinationViewController];
  }

My question is. Why when I try access a property in the secondTableView for example:

secondTableView.myString = @"goodBye";

I get this error:

Property "myString" not found on object of type "UTableViewController".

My question is how can I fix this or if is a way around this error.

I'll really appreciate your help

m59
  • 43,214
  • 14
  • 119
  • 136
user3094099
  • 63
  • 1
  • 6

2 Answers2

1

Try this:

    UITableViewController *secondTableView = (UITableViewController*)[segue destinationViewController];

And make sure myString should be declared as property.

Then you should try this

secondViewControllwer *secondView = (secondViewControllwer*)[[secondViewControllwer alloc]init];

And class name should start with capital latter.

Bhumeshwer katre
  • 4,671
  • 2
  • 19
  • 29
  • Doesn't work because I still don't get any reference to my secondViewController. for example secondViewControllwer *secondView = [secondViewControllwer alloc]init] in that case I'm getting a pointer to the second class – user3094099 Dec 13 '13 at 21:47
  • @user3094099 what are you saying not cleared. What is your class name? If your class is `secondViewControllwer` then see my updated answer. – Bhumeshwer katre Dec 13 '13 at 22:00
0

You are accessing undefined property on UITableViewController, moreover you cannot declare custom property on standard UITableViewController, you can only inject methods using category. I am wondering if UITableViewController is what you intended for secondTableView type?

ldindu
  • 4,270
  • 2
  • 20
  • 24