【发布时间】:2012-02-24 22:49:47
【问题描述】:
我在 Cocoa 中使用 addoperationwithblock 时遇到了一点麻烦。假设我有一个主函数
-(IBAction) callthisone {
// Call another function "slave" here and store returned value in result
result = return value from slave
NSLog(@" result is %@",result);
}];
}
-(NSArray *) slave {
[operationQueue addOperationWithBlock: ^{
NSString * result = @"5" ;
}];
return result;
}
我永远无法得到主服务器中返回的结果值。我该怎么做呢 ?我的方法正确吗?谢谢
【问题讨论】:
-
那些不是函数,它们是方法。大不同。