facebook graph api - iOS: Passing data between View Controllers -
i'm using facebook api, , when user select place (checkin), want open view , pass place (fbgraphplace), in "secondviewcontroller" variable null when method "viewdidload" executed. when user select place:
if (secondviewcontroller == nil) { secondviewcontroller *secondviewcontroller = [[secondviewcontroller alloc] initwithnibname:nsstringfromclass([secondviewcontroller class]) bundle:[nsbundle mainbundle]]; self.secondviewcontroller = secondviewcontroller; } // how reference navigation controller // little different uibarbuttonitem *newbackbutton = [[uibarbuttonitem alloc] initwithtitle: @"back" style: uibarbuttonitemstylebordered target: nil action: nil]; [[self navigationitem] setbackbarbuttonitem: newbackbutton]; secondviewcontroller.place = self.selectedplace; [self.navigationcontroller pushviewcontroller:self.secondviewcontroller animated:yes];
you should pushviewcontroller first, assign place variable
ios facebook-graph-api uiviewcontroller
No comments:
Post a Comment