mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +00:00
* fix incorrect error of migration to device * alert to finish migration, ios fix * simplexmq * catching exception and stopping chat * text --------- Co-authored-by: Avently <7953703+avently@users.noreply.github.com>
25 lines
545 B
Objective-C
25 lines
545 B
Objective-C
//
|
|
// objc.m
|
|
// SimpleXChat
|
|
//
|
|
// Created by Stanislav Dmitrenko on 09.09.2024.
|
|
// Copyright © 2024 SimpleX Chat. All rights reserved.
|
|
//
|
|
|
|
#import "objc.h"
|
|
|
|
@implementation ObjC
|
|
|
|
// https://stackoverflow.com/a/36454808
|
|
+ (BOOL)catchException:(void(^)(void))tryBlock error:(__autoreleasing NSError **)error {
|
|
@try {
|
|
tryBlock();
|
|
return YES;
|
|
}
|
|
@catch (NSException *exception) {
|
|
*error = [[NSError alloc] initWithDomain: exception.name code: 0 userInfo: exception.userInfo];
|
|
return NO;
|
|
}
|
|
}
|
|
|
|
@end
|