Calling a function from a different view controller for iphone

后端 未结 3 1859
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-13 04:53

I have a problem where I want to call a function defined in one view controller from another controller. I\'v try what seems llke a hundred different setups and nothing seem

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-13 05:22

    "Hi All, I have a problem where I want to call a function defined in one view controller from another controller. I'v try what seems llke a hundred different setups and nothing seems to work."

    This is because it is bad design. Controllers should not directly talk to each other.

    You should consider using delegates, notifications or some shared central entity.

提交回复
热议问题