-(NSInteger) buttonIndexWithMessage:(NSString *) title andArrayOfOptions:(NSArray *) options
{
self.operation=[NSOperationQueue new];
[self.operation addOperationWithBlock:^{
[[NSOperationQueue mainQueue]addOperationWithBlock:^{
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:title
delegate:self
cancelButtonTitle:nil
destructiveButtonTitle:nil
otherButtonTitles:nil];
for (NSString * strOption in options) {
[actionSheet addButtonWithTitle:strOption];
}
[actionSheet showInView:[BGMDApplicationsPointers window]];
}];
self.operation.suspended=true; //Okay make t
}];
[self.operation waitUntilAllOperationsAreFinished];//Don't get out of the function till user act.
//Wait till delegate is called.
return self.buttonIndex;//I want to return buttonIndex here.
}
self.operationが終了していなくても、実行ポイントはself.buttonIndexを返すまで移動し続けます。