ios - PrepareForSegue issues -
i have 3 methods below using storyboard have "segue" connect "view movie info" button next view. identifier "web"
when click on button call method: (ibaction)synopsis:(id)sender method calls -> (void)fetchemovie:(nsdata *)responsedata , should go (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)jason
on prepareforsegue method put nsslog on "jsonsendetasparaminperformsegue" , 2 logs
1: uiroundedrectbutton: 0x9595c60; frame = (11 322; 298 44); opaque = no; autoresize = tm+bm; layer = calayer: 0x9595d30
2->my json results ( expect )
and below this: 2013-05-09 18:55:06.185 drigo[840:c07] nested push animation can result in corrupted navigation bar unbalanced calls begin/end appearance transitions . finishing navigation transition in unexpected state. navigation bar subview tree might corrupted.
i need 1 of values json , pass next view
the methods below.. please help.. i've been stuck couple of days on this
- (ibaction)synopsis:(id)sender { nsstring *urlstring = [nsstring stringwithformat:@"http://api.themoviedb.org/3/movie/%@?api_key=34eb86f3b94de2676e8d3007b5ce1993",movieid]; dispatch_async(kbgqueue, ^{ nsurl *url = [nsurl urlwithstring:urlstring]; nsdata* data = [nsdata datawithcontentsofurl:url]; [self performselectoronmainthread:@selector(fetchemovie:)withobject:data waituntildone:no]; }); } - (void)fetchemovie:(nsdata *)responsedata { nserror* error; nsdictionary* json = [nsjsonserialization jsonobjectwithdata:responsedata options:kniloptions error:&error]; news = [nsjsonserialization jsonobjectwithdata:responsedata options:kniloptions error:&error]; [self performseguewithidentifier:@"web" sender:news]; } - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)jason { nserror* error; nsdictionary *jsonsendetasparaminperformsegue = (nsdictionary*)jason; nslog(@"%@",jsonsendetasparaminperformsegue); //webviewcontroller *targetvc = (webviewcontroller*)segue.destinationviewcontroller; //targetvc.newsarticles = jsonsendetasparaminperformsegue; }
you should connect segue source viewcontroller destination viewcontroller, don't connect button.
if connect button, when click button, performs segue(the sender button), in code call perform segue again, why it's wrong.
Comments
Post a Comment