iphone - Interact with a view controller from another view controller -
i want view controller check if there image on view controller when click button. of there image simulator not execute loop.
code:
- (ibaction)buttonclicked:(id)sender { iphotoviewcontroller *photo = [[iphotoviewcontroller alloc] initwithnibname:@"iphotoviewcontroller" bundle:nil] ; if (photo.mainview.image) { = (uibutton *) sender; self.selectedimage = [_images objectatindex:but.tag]; iphoto2appdelegate *delegate = [[uiapplication sharedapplication] delegate]; [delegate.navcontroller popviewcontrolleranimated:yes]; [photo release]; }
thanks, praveen
you creating new instance of iphotoviewcontroller
means image want use must available in nib file. , being available in nib file means available in project creating new iphotoviewcontroller
see if image there seems bit strange.
is there perhaps instance of iphotoviewcontroller
somewhere have loaded image? if instance need check.
but perhaps testing things , have set image in nib , want make sure works. in case, reason photo.mainview.image
not set because have created view controller view not yet been loaded , setup nib. fake need access view
property of controller before checking if image set.
iphotoviewcontroller *photo = [[iphotoviewcontroller alloc] initwithnibname:@"iphotoviewcontroller" bundle:nil] ; [photo view]; if (photo.mainview.image) { // continue before
Comments
Post a Comment