I have four viewControllers in my current design and I am designing an app to sell a product.
FirstViewController
gets the product image and when user clicks to the next button then it takes user to the secondviewcontroller
where user describes the product and then user clicks next button which takes user to the thirdViewcontroller
where price and condition are entered. In the lastviewcontolller
there is a post button to send the product info to the server. I am using POST
method.
The following segue approach does not fit into what I want, because it sends the firstviewcontroller
object (product image) to the secondviewcontoller
, and then secondviewcontroller
also should forward the product image to the thirdviewcontoller
and so on. I do not think it is a feasible way of doing it.
I wonder what is the best way of collection information from the first page till to the last page and send it. What is best way of handling that issue? I am using segue between the viewcontrollers.
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Make sure your segue name in storyboard is the same as this line
if ([[segue identifier] isEqualToString:@"isSecond"])
{
// Get reference to the destination view controller
SecondViewController *vc = [segue destinationViewController];
// Pass any objects to the view controller here, like...
[vc setMyProductImage:productImage];
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…