Daniel05
Daniel05

Reputation: 105

unrecognized selector sent to instance - mistake in properties?

I know that this question is asked for many times but i am working on it hard and can not find the mistake!

I have made a navigation based application. To costumize the appereance of the table view cells i used this method in my RootViewController:

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

   Verwaltung Information * selectedFormel = [listOfFormularies    objectAtIndex:indexPath.row];
   cell.textLabl.text = selectedFormel.nameFormel;

   return cell;
}

The variable "nameFormel" is declared in VerwaltungInformation as NSString with property and synthesize. But instead I get this error message:

[FormelViewController nameFormel]: unrecognized selector sent to instance
Terminating app due to uncaught exception 'NSInvalidArgument', reason : [FormelViewControlle nameFormel]: unrecognized selector sent to instance

I need some help! Since days I have been working on it but I can NOT find the error...If somebody need some more details to answer, please leave a comment.

Upvotes: 0

Views: 146

Answers (1)

tilo
tilo

Reputation: 14169

Your problem is that [listOfFormularies objectAtIndex:indexPath.row] returns an FormelViewController object, not an object of type VerwaltungInformation.

You should check your data (i.e. the listOfFormularies array).

Upvotes: 2

Related Questions