File tree Expand file tree Collapse file tree 1 file changed +2
-18
lines changed
lib/motion/project/template/osx Expand file tree Collapse file tree 1 file changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -230,36 +230,20 @@ def main_cpp_file_txt(spec_objs)
230
230
end
231
231
main_txt << <<EOS
232
232
RubyMotionInit(argc, argv);
233
- NSApplication *app = [NSClassFromString(@" #{ info_plist [ 'NSPrincipalClass' ] } ") sharedApplication];
233
+ NSApplication *app = [NSApplication sharedApplication];
234
234
[app setDelegate:[NSClassFromString(@"#{ delegate_class } ") new]];
235
235
EOS
236
236
if spec_mode
237
237
main_txt << "SpecLauncher *specLauncher = [[SpecLauncher alloc] init];\n "
238
238
main_txt << "[[NSNotificationCenter defaultCenter] addObserver:specLauncher selector:@selector(appLaunched:) name:NSApplicationDidFinishLaunchingNotification object:nil];\n "
239
239
end
240
- if use_application_main_function?
241
- main_txt << "NSApplicationMain(argc, (const char **)argv);\n "
242
- else
243
- main_txt << "[app run];\n "
244
- end
245
240
main_txt << <<EOS
241
+ NSApplicationMain(argc, (const char **)argv);
246
242
[pool release];
247
243
rb_exit(0);
248
244
return 0;
249
245
}
250
246
EOS
251
247
end
252
-
253
- # If the user specifies a custom principal class the NSApplicationMain()
254
- # function will only work if they have also specified a nib or storyboard.
255
- def use_application_main_function?
256
- info = info_plist
257
- if info [ 'NSPrincipalClass' ] == 'NSApplication'
258
- true
259
- else
260
- files = info . values_at ( 'NSMainNibFile' , 'NSMainStoryboardFile' ) . compact
261
- files . any? { |file | !file . strip . empty? }
262
- end
263
- end
264
248
end
265
249
end ; end
You can’t perform that action at this time.
0 commit comments