ios6 - Unable to dismiss a UIPopover from another class -
i have ipad app, created in xcode 4.6.3, ios 6.2, arc , storyboards.
i create uipopover programmatically in subviewdata.m.
@property (strong, nonatomic) uipopovercontroller *popover; // make rectangle attach popover cgrect rectangle = cgrectmake( touchpoint.x, touchpoint.y, 110, 1); // 0 height puts arrow on exact touch point // addressability storyboard viewcontroller uiviewcontroller *popovermainview = [[uistoryboard storyboardwithname:@"mainstoryboard" bundle:nil] instantiateviewcontrollerwithidentifier:@"menuview"]; popover = [[uipopovercontroller alloc] initwithcontentviewcontroller:popovermainview]; [popover presentpopoverfromrect:rectangle inview:self permittedarrowdirections:uipopoverarrowdirectionany animated:yes];
i set notifications in class (quickappointment.m) when uibutton in popover has been tapped. notification , issue code calendarviewcontroller.m :
subviewdata *svd = [[subviewdata alloc] init]; [svd.popover dismisspopoveranimated:yes];
nothing happens! don't understand why not... so, doing wrong?
look @ code writing:
subviewdata *svd = [[subviewdata alloc] init];
this creates completely new , different instance of subviewdata, , not 1 displaying popover.
Comments
Post a Comment