ios - Block isn't recognized unless it is defined in the same class -


i trying define instance variable block

i have 2 classes follows

@interface classa:nsobject  typedef void (^ablock)(void); @end   #import "classa.h" @interface classb :nsobject  -(void)somemethodwithablock:(ablock)block;   @end 

in class b "ablock" type not recognized unless written right above "somemethodwithablock"

how can fix it?

you want this?

typedef void (^blocka)(void);  #import <foundation/foundation.h>  @interface classa : nsobject {     blocka classablocka; }  @end  @interface classb : nsobject {     blocka classbblocka; }  @end 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -