Monday, March 10, 2014

Block Type


Return_Type  (^ Block_Name) (Parameters)



void (^ x) (void)  =   ^{
       NSLog(@"block--without--parameter--without--returntype");
};
    
    
void (^ xx) (int)  =  ^(int a){
        NSLog(@"bloc--with-one-parameter--without--returnType -- %d", a);
};

    
void (^ xxx) (intNSString *)  =  ^(int a, NSString *s){
        NSLog(@"block--with-two-parameters--without--returnType - %d -- %@", a, s);
};

    
NSString* (^ xxxx) (intNSString *)  =   ^(int a, NSString *s){
        NSString *ss = [NSString stringWithFormat:@"block--with--parameters--and--returntype %@ - %d", s, a];
        return ss; 
};