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

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -