uiview - Push notification to view iPhone -
uiview - Push notification to view iPhone -
i have got force notification working next thing want open relevant view when clicking on notification.
in appdelegate.m in didfinishlaunchingwithoptions, have following:
nsstring *params=[[launchoptions objectforkey:@"uiapplicationlaunchoptionsremotenotificationkey"] objectforkey:@"alerttype"]; if ([params length] > 0 ) {//app launch when view button of force notification clicked if (params == @"sc") { alerts *alerts = [[alerts alloc] initwithnibname:@"alerts" bundle:nil]; [[self navigationcontroller] pushviewcontroller:alerts animated:yes]; [alerts release]; } else { } } however, in line: [[self navigationcontroller] pushviewcontroller:alerts animated:yes];, warning comes saying method '-navigationcontroller' not found (return type defaults 'id').
how can rectify warning , right in trying force relevant view in didfinishlaunchingwithoptions?
thanks.
your navigationcontroller may not declared @property, can't utilize [self navigationcontroller]. seek self.navigationcontroller, or navigationcontroller, if that's name in .h.
also, please don't compare strings ==. have if ([params isequaltostring:@"sc"]). compares contents instead of address of string.
iphone uiview delegates push push-notification
Comments
Post a Comment