我得到一个错误
变量不可赋值(缺少__block类型说明符)
在线人=参与者;我如何确保块可以访问person变量和person变量可以返回?
Person *aPerson = nil;
[participants enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
Person *participant = (Person*)obj;
if ([participant.gender isEqualToString:@"M"]) {
aPerson = participant;
*stop = YES;
}
}];
return aPerson;