File tree Expand file tree Collapse file tree 5 files changed +16
-7
lines changed
AppWithModules/Source Files
project-template/internal Expand file tree Collapse file tree 5 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ int main(int argc, char *argv[]) {
2424 config.ArgumentsCount = argc;
2525 config.Arguments = argv;
2626
27- nativescript = [NativeScript alloc ] initWithConfig: config];
27+ nativescript = [[NativeScript alloc ] initWithConfig: config];
28+ [nativescript runMainApplication ];
2829
2930 return 0 ;
3031 }
Original file line number Diff line number Diff line change 1515@interface NativeScript : NSObject
1616
1717- (instancetype )initWithConfig : (Config*)config ;
18+ /* *
19+ WARNING: this method does not return in most applications. (UIApplicationMain)
20+ */
21+ - (void )runMainApplication ;
1822- (bool )liveSync ;
1923
2024@end
Original file line number Diff line number Diff line change @@ -53,18 +53,20 @@ - (instancetype)initWithConfig:(Config*)config {
5353 inspectorClient->registerModules ();
5454 inspectorClient->connect ([config ArgumentsCount ], [config Arguments ]);
5555 }
56-
57- runtime_->RunMainScript ();
58-
59- CFRunLoopRunInMode (kCFRunLoopDefaultMode , 0 , true );
60-
61- tns::Tasks::Drain ();
6256 }
6357
6458 return self;
6559
6660}
6761
62+ - (void )runMainApplication {
63+ runtime_->RunMainScript ();
64+
65+ CFRunLoopRunInMode (kCFRunLoopDefaultMode , 0 , true );
66+
67+ tns::Tasks::Drain ();
68+ }
69+
6870- (bool )liveSync {
6971 if (runtime_ == nullptr ) {
7072 return false ;
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ int main(int argc, char *argv[]) {
2525 config.Arguments = argv;
2626
2727 nativescript = [[NativeScript alloc ] initWithConfig: config];
28+ [nativescript runMainApplication ];
2829
2930 return 0 ;
3031 }
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ int main(int argc, char *argv[]) {
5757 config.Arguments = argv;
5858
5959 nativescript = [[NativeScript alloc ] initWithConfig: config];
60+ [nativescript runMainApplication ];
6061
6162 return 0 ;
6263 }
You can’t perform that action at this time.
0 commit comments