I would like to know which is the best way to send parameters between viewControllers. I know there are two possibilities, pass the parameters in the public properties after the init call.
ViewController *vc = [ViewController alloc] init];
vc.propertyOne = @"whatever";
vc.propertyTwo = @"whatever2";
Or creating a new Custom init like
initWithProperty:(NSString *)prperty1 andPropertyTwo:(NSString *)property2
{
self = [super init];
if (self) {
self.propertyOne = prperty1;
self.propertyTwo = property2;
}
return self;
}
ViewController *vc = [[ViewController alloc] initWithProperty:@"whatever andPropertyTwo:@"xxxx"];
I would like to know Advantages and disadvantages of each one, and "when" and "why" is better use one of them.