我一直在使用Xcode中的iPad的SplitView模板.以下是基于Split View的应用程序模板为您自动生成的许多重要方法中的两个...
AppNameAppDelegate.m
#pragma mark -
#pragma mark Application lifecycle
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after app launch
rootViewController.managedObjectContext = self.managedObjectContext;
// Add the split view controller's view to the window and display.
[window addSubview:splitViewController.view];
[window makeKeyAndVisible];
return YES;
}
Run Code Online (Sandbox Code Playgroud)
RootViewController.m
#pragma mark -
#pragma mark View lifecycle
- (void)viewDidLoad {
[super viewDidLoad];
self.clearsSelectionOnViewWillAppear = NO;
self.contentSizeForViewInPopover = CGSizeMake(320.0, 600.0);
NSError *error = nil;
if (![[self fetchedResultsController] performFetch:&error]) {
NSLog(@"Unresolved error %@, %@", error, …Run Code Online (Sandbox Code Playgroud) 我在swift中有一个firebase应用程序.现在我的问题很容易解释,但调试真的很奇怪.
问题:每当我打开应用程序时,它都可以正常运行.是应该做的一切等等.但是当我在背景中离开应用程序一段时间并打开它时,我会崩溃.我必须重新打开它2次才能发生撞击或杀死它.
重新产生错误:第1步:打开应用程序(在那里做一些事情或者只是离开它)然后回到家里而不是杀死它,将它保留在后台
第2步:过一会儿打开应用程序.--->崩溃
步骤3:在一段时间之后在步骤2之后再次打开它或立即--->再次崩溃
第4步:第三次打开它.--->工作完全没问题.
注意:为了逃避崩溃我总是要杀死它.总的来说,这是一个非常糟糕
另外,我检查了我的plists.他们运作正常.然而,当它崩溃我得到这个错误:
2018-12-20 19:05:44.272413-0800 SpotMi[15557:862318] *** Terminating app due to uncaught exception 'FIRAppNotConfigured', reason: 'Failed to get default Firebase Database instance. Must call `[FIRApp configure]` (`FirebaseApp.configure()` in Swift) before using Firebase Database.'
*** First throw call stack:
(0x1a1e2bea0 0x1a0ffda40 0x1a1d32674 0x1030c8d20 0x102f9cd24 0x102f992b0 0x102f9926c 0x10f928dc8 0x10f92ae28 0x10ef95e18 0x102f9935c 0x102f49644 0x102f4a55c 0x102f4ad94 0x102e03b18 0x102d5cd4c 0x102f49260 0x102f493b0 0x102f4ac74 0x102f4b11c 0x102dbaf3c 0x102dbafd8 0x1cea6620c 0x1cea6663c 0x1cf0551e4 0x1cf051200 0x1cf0240a0 0x1cf02585c 0x1cf02b2a8 0x1ce8c7358 0x1ce8cffd8 0x1ce8c6fd4 0x1ce8c7974 0x1ce8c5a74 0x1ce8c5720 0x1ce8ca8e0 0x1ce8cb840 …Run Code Online (Sandbox Code Playgroud)