block链式编程

@bingoogolapple 2015-08-10 14:12:00发表于 bingoogolapple/bingoogolapple.github.io iOS

- (Person *(^)(NSString *))study {
    return ^(NSString *name){
        NSLog(@"study----%@", name);
        return self;
    };
}

- (Person *(^)())run {
    return ^{
        NSLog(@"run----");
        return self;
    };
}

////////////////////////////////////////////////////////////////////////////////////////////////////

Person *p = [[Person alloc] init];
p.study(@"xx宝典").run().study(@"xx剪发");