ios - Transferring JSON variable between Classes -


i managed json variable in variable in new class through following function:

class gamesoverview: interface, uitableviewdatasource, uitableviewdelegate{      override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject!) {         if (segue.identifier == "presentgame") {             var presentgame = segue.destinationviewcontroller as! game;             presentgame.gamestate = self.gamestate;             println(presentgame.gamestate);          }     } } 

however when run viewdidload in next class variable self.gamestate not yet filled. filled 2nd time enter class:

class game: interface{      override func viewdidload() {         super.viewdidload();         println(self.gamestate!);     } } 

why isn't self.gamestate! filled @ first time? , how fix this?


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -