Passing data between classes using Objective-C

后端 未结 4 737
时光取名叫无心
时光取名叫无心 2020-12-18 13:01

I need some info about how to pass data between classes.. To be specific, I want to store in a class in an array some info, (using model store class), and then use it in ano

4条回答
  •  忘掉有多难
    2020-12-18 13:36

    1. just declare array(let array2) in second class(MYSecondView) and do not forget to set his propert and synthesize. and then go to first class in .h file and import class(#import "MySecondView") where you define array2.
    2. create an object of second class(MySecondView *objMySecondView=[MySecondView alloc]init];) in your first class. then pass value to array2 from array of first class. like

      objMySecondView.array2 setObjectFromArray=array1;
      

提交回复
热议问题