Saturday 15 January 2011

ios - warning: Attempt to present modal when notification is called -



ios - warning: Attempt to present modal when notification is called -

i calling presentmodal method on viewdidappear using :

[[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(presentmodal) name:@"xxxxxxx" object:nil]; -(void)presentmodal { pickermodalviewcontroller *pickermodalviewcontroller = [appdelegate.window.rootviewcontroller.storyboard instantiateviewcontrollerwithidentifier:@"pickermodalviewcontroller"]; pickertype = 2; pickermodalviewcontroller.choices = self.localarray; pickermodalviewcontroller.buttontag = pickertype; pickermodalviewcontroller.delegate = self; self.pickerpresenter = self; if (self.pickerpresenter) { [self.pickerpresenter presentviewcontroller:pickermodalviewcontroller animated:yes completion:nil]; } }

when picker presented gives me waring in both device , simulator

warning: attempt nowadays pickermodalviewcontroller: 0x10ec7280 on uinavigationcontroller: 0x90ad610 while presentation in progress!

the warning says you, wrong. avoid warning can utilize delegate property of uinavigationcontroller , implement

- (void)navigationcontroller:(uinavigationcontroller *)navigationcontroller didshowviewcontroller:(uiviewcontroller *)viewcontroller animated:(bool)animated

ios iphone

No comments:

Post a Comment