passing data between views

后端 未结 3 1067
南方客
南方客 2020-12-11 10:20

So i\'m trying to pass data between two views (first view is tableViewController,when cell is pressed data is send to second view,second view got imageView, when data is sen

3条回答
  •  执念已碎
    2020-12-11 10:45

    In any class where you want to set any variable of the "AppDelegate Class", you can try this, this will surely solve your problem.

     //Declare a variable from where you want to set the value of the "AppDelegate Class". 
     //in the yourclass.h file.
     AppDelegate/* this is the main class of the Application*/ *appDel;
    
    //and initialize it where you want to use or you can initialize at the init of the class.  
    
    appDel = (AppDelegate *)[[UIApplication sharedApplication]delegate];
    
     // Then set the value.
     appDel.imageString = tempImageString;
    

提交回复
热议问题