objective c - Importing view controllers for delegation not working -


i have view controller, firstviewcontroller, subclass, fourthviewcontroller. firstviewcontroller's interface is:

#import "fourthviewcontroller.h" @interface firstviewcontroller : uiviewcontroller <fourthviewcontrollerdelegate> 

in fourthviewcontroller's .h, have:

#import "firstviewcontroller.h"  @protocol fourthviewcontrollerdelegate -(void) updatelabel; @end  @interface fourthviewcontroller : firstviewcontroller   @property (weak, nonatomic) id<fourthviewcontrollerdelegate>delegate; 

this giving me error message: cannot find interface declaration of 'firstviewcontroller', superclass of 'fourthviewcontroller' i'm not sure why error occuring. advice help.

is keeping delegate in same .h file controller critical you? pulled separate .h file , whole thing worked me. this:

//firstviewcontroller.h #import <foundation/foundation.h>  #import "fourthviewcontrollerdelegate.h" @interface firstviewcontroller : uiviewcontroller <fourthviewcontrollerdelegate> @end  //fourthviewcontrollerdelegate.h #import <foundation/foundation.h>  @protocol fourthviewcontrollerdelegate <nsobject> -(void) updatelabel; @end  //fourthviewcontroller.h #import <foundation/foundation.h>  #import "firstviewcontroller.h" #import "fourthviewcontrollerdelegate.h"  @interface fourthviewcontroller : firstviewcontroller  @property (weak, nonatomic) id<fourthviewcontrollerdelegate>delegate; @end 

Comments

Popular posts from this blog

Issues changing the value of an element in an array in matlab -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

vb.net - Alternative to the T-SQL AS keyword -