iphone - [UINavigationController setGoalName:]: unrecognized selector sent to instance 0x7964e2c0 -


i have created app following code. working fine ios7 throws below error when run ios8.

[uinavigationcontroller setgoalname:]: unrecognized selector sent instance 0x7964e2c0 

my firstviewcontroller.m

- (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender {  goaldetailsviewcontroller *goalsdetailsviewcontroller = segue.destinationviewcontroller; nslog(@"%@",[nsstring stringwithformat:@"%@", [[self.arrcategorytitle objectatindex:indexpath.row] objectatindex:indexofcategory]]); goalsdetailsviewcontroller.goalname = @"exercise daily";  } 

my goaldetailsviewcontroller.h

@interface goaldetailsviewcontroller : uiviewcontroller <uitableviewdelegate, uitableviewdatasource>  @property (nonatomic) nsstring *goalname; 

thanks in advance.

seems destinationviewcontroller subclass of uinavigationcontroller.

try this:

- (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender {  goaldetailsviewcontroller *goalsdetailsviewcontroller = [(uinavigationcontroller*)segue.destinationviewcontroller topviewcontroller]; nslog(@"%@",[nsstring stringwithformat:@"%@", [[self.arrcategorytitle objectatindex:indexpath.row] objectatindex:indexofcategory]]); goalsdetailsviewcontroller.goalname = @"exercise daily";  } 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -