ios - when i push viewcontroller in navigation controller, shows black screen - empty view -
i tried using storyboard instantiateviewcontrollerwithidentifier , working fine needed delegate method added below code when opening secondviewcontroller firstviewcontroller,
secondviewcontroller *svc=[[seconviewcontroller alloc] init]; svc.delegate=self; [self.navigationcontroller pushviewcontroller:svc animated:yes];
but opens black screen.any sort appreciated. thank you.
secondviewcontroller.h file
@protocol senddatatoaudiodelegate <nsobject> -(void)senddata:(nsmutablearray *) data; @end @interface audiosavedfilesviewcontroller : uiviewcontroller <uitableviewdatasource, uitableviewdelegate> @property (strong, nonatomic) iboutlet uitableview *filetable; @property (strong, nonatomic) nsmutablearray *selectedindices; @property (strong, nonatomic) avaudioplayer *audioplayer; - (ibaction)selectedfiles:(id)sender; @property (nonatomic,assign)id <senddatatoaudiodelegate> delegate; @end
here:
secondviewcontroller *svc= [self.storyboard instantiateviewcontrollerwithidentifier @"identifier"]; svc.delegate=self;
you trying set secondviewcontroller's delegate property. error getting when doing so:
property delegate not found on object type 'uiviewcontroller'
suggest secondviewcontroller class not have property called delegate. hence need:
@interface secondviewcontroller @property (nonatomic, assign) id delegate; @end
Comments
Post a Comment