Welcome to mirror list, hosted at ThFree Co, Russian Federation.

main.mm « Maps « iphone - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: be3528d77b84ef84fbbc1044c690d05dae9258b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <Foundation/NSThread.h>
#import "Common.h"

#include "../../platform/file_logging.hpp"
#include "../../platform/platform.hpp"
#include "../../platform/settings.hpp"


/// Used to trick iOs and enable multithreading support with non-native pthreads.
@interface Dummy : NSObject 
- (void) dummyThread: (id) obj;
@end

@implementation Dummy
- (void) dummyThread: (id) obj {}
@end

int main(int argc, char * argv[])
{
#ifdef MWM_LOG_TO_FILE
  my::SetLogMessageFn(LogMessageFile);
#endif
  LOG(LINFO, ("maps.me started, detected CPU cores:", GetPlatform().CpuCores()));

  int retVal;
  @autoreleasepool
  {
    Dummy * dummy = [Dummy alloc];
    NSThread * thread = [[NSThread alloc] initWithTarget:dummy selector:@selector(dummyThread:) object:nil];
    [thread start];

    // We use this work-around to avoid multiple calls for Settings::IsFirstLaunch() later with invalid results,
    // as it returns true only once, on the very first call
    [[NSUserDefaults standardUserDefaults] setBool:(Settings::IsFirstLaunch()) forKey:FIRST_LAUNCH_KEY];
    [[NSUserDefaults standardUserDefaults] synchronize];

    retVal = UIApplicationMain(argc, argv, nil, nil);
  }
  return retVal;
}