Passing data from the FirstViewController to the LastViewController

后端 未结 3 924
再見小時候
再見小時候 2020-12-22 01:13

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

3条回答
  •  清酒与你
    2020-12-22 01:25

    Create an object to act as your application's data model. It can be a singleton or it can be a normal object that's available from a known location...such as owned by the app delegate.

    Update your model when you have new information and read from the model when you need to display something. Using prepareForSegue: and linking controllers may be acceptable for simple things but it really doesn't scale well.

提交回复
热议问题