mercredi 2 juillet 2014

UIActivityViewController pushViewController


Vote count:

0




in my ViewController I have a button and when it is pushed I do:



activityController = [[UIActivityViewController alloc] initWithActivityItems:@[my_item] applicationActivities:@[myActivity1,myActivity2]];


and then:



[self presentViewController:activityController animated:YES completion:nil];


Here is all right, the problem is the following: I created the two Activity classes: "myActivity1" and "myActivity2", and in particular I would push a View controller if I click on the icon that corresponds to myActivity2. Therefore in myActivity2.m I do:



-(UIViewController*)activityViewController{
MyViewControllerToPush *myVC = [[ MyVieControllerToPush alloc]init];
myVC.var = self.var;
return myVC;
}


The problem is that in this way it is not pushed and in MyViewControllerToPush I have some button that if clicked they push to another ViewController and this doesn't work:



[self.delegate.navigationController pushViewController:mySecondVC animated:YES];


but if I do:



[self.delegate.navigationController present.....]


It works!


Problem: In mySecondVC I have a back button and all the ViewController are presented and not pushed so I can't pop the view controller, it doesn't work, but I can't change that class because I use it in many other parts of the app.


Therefore at the end (I'm sorry for this long post), I would know if there is a way to push myActivity2 when I click on the right icon, or a way to solve my problem.


Thanks



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire