farcaller/Injective — Issue #2: Verify that all properties are passed in props dict
Author: farcaller
Created: 2012-01-31 11:29:47+00:00
State: open
Labels: feature

Consider a case like

```objc
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
MYEpisode *ep = [self.episodes objectAtIndex:indexPath.row];
PCCastDetailViewController *dvc = [[PCCastDetailViewController alloc] init];
dvc.episode = ep;
[self.navigationController pushViewController:dvc animated:YES];
}
```

it could be rewritten with Injective as

```objc
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
MYEpisode *ep = [self.episodes objectAtIndex:indexPath.row];
NSDictionary *props = [NSDictionary dictionaryWithObject:ep forKey:@"episode"];
PCCastDetailViewController *dvc = [PCCastDetailViewController injectiveInstantiateWithProperties:props];
[self.navigationController pushViewController:dvc animated:YES];
}
```

but you can still forget to include *episode* property (no strict enforcement). It would be nice to enforce such a check from Injective.