update objective-C style
This commit is contained in:
@@ -15,8 +15,8 @@
|
||||
|
||||
@property UIDocumentPickerViewController *documentPicker;
|
||||
@property (nonatomic, copy) void (^completionHandler)(NSString *selectedFile);
|
||||
- (void)PresentDocumentPickerWithCompletionHandler:(void (^)(NSString *selectedFile))completionHandler;
|
||||
|
||||
- (void)presentDocumentPickerWithCompletionHandler:(void (^)(NSString *selectedFile))completionHandler;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ static std::string selectedFile;
|
||||
|
||||
void ShowOpenFileDialogImpl(void (^completionHandler)(std::string)) {
|
||||
AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
|
||||
[appDelegate presentDocumentPickerWithCompletionHandler:^(NSString *filePath) {
|
||||
[appDelegate PresentDocumentPickerWithCompletionHandler:^(NSString *filePath) {
|
||||
selectedFile = std::string([filePath UTF8String]);
|
||||
completionHandler(selectedFile);
|
||||
}];
|
||||
@@ -35,11 +35,6 @@ std::string ShowOpenFileDialogSync() {
|
||||
result = filePath;
|
||||
});
|
||||
|
||||
// Check if the documentPicker is done
|
||||
// while (result.empty()) {
|
||||
// [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]];
|
||||
// }
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user