This is a problem that occurs for a long time tonight. If you use segue, the normal execution order is: first execute the prepareforsegue of the source viewcontroller, and then execute the viewdidload of the target VC, therefore, you can set the attributes of the destination Vc in prepareforsegue to transfer the value. However, when you use the segue in the popover scenario, the situation is different. The system first calls the viewdidload for the purpose and then calls the prepareforsegue of the source vc. It is reversed, therefore, the method of passing values by value just mentioned won't work (especially when you need to use this attribute for some logic in the target viewdidload ).
Solution: Method 1: discard the segue and directlyCodeAdd A popover.
Destinationvc =[StoryboardInstantiateviewcontrollerwithidentifier:@ "Destinationvc"];
Destinationvc. Mmm = @ "Hello Zhan! ";
Popover =[[Uipopovercontrolleralloc]Initwithcontentviewcontroller: Destinationvc]; // The viewdidload
.......
Method 2: Put the logic of viewdidload in a function and change the logic in the prepareforsegue of the source vc. This stackoverflow also mentions http://stackoverflow.com/questions/8838160/prepareforsegue-is-not-called-after-performseguewithidentifier-with-popover-st