forked from organicmaps/organicmaps
[iOS] Added NSException logging.
This commit is contained in:
parent
8bb6e70721
commit
13a9ebd004
1 changed files with 15 additions and 3 deletions
|
@ -3,10 +3,11 @@
|
|||
#import <Foundation/NSThread.h>
|
||||
|
||||
#include "../../platform/platform.hpp"
|
||||
|
||||
#include "../../base/logging.hpp"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
/// Used to trick iOs and enable multithreading support with non-native pthreads
|
||||
|
||||
/// Used to trick iOs and enable multithreading support with non-native pthreads.
|
||||
@interface Dummy : NSObject
|
||||
- (void) dummyThread: (id) obj;
|
||||
@end
|
||||
|
@ -14,12 +15,23 @@
|
|||
@implementation Dummy
|
||||
- (void) dummyThread: (id) obj {}
|
||||
@end
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/// Used to log NSExceptions.
|
||||
static void exceptionHandler(NSException * ex)
|
||||
{
|
||||
NSArray *stack = [ex callStackSymbols];
|
||||
NSLog(@"%@", ex.name);
|
||||
NSLog(@"%@", ex.reason);
|
||||
NSLog(@"Stack trace: %@", stack);
|
||||
}
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
LOG(LINFO, ("MapsWithMe started, detected CPU cores:", GetPlatform().CpuCores()));
|
||||
|
||||
NSSetUncaughtExceptionHandler(&exceptionHandler);
|
||||
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
Dummy * dummy = [[Dummy alloc] autorelease];
|
||||
|
|
Loading…
Add table
Reference in a new issue