- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试在 iOS 上使用电子邮件和密码进行简单登录。登录时出现以下错误。
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]' * First throw call stack: ( 0 CoreFoundation 0x02eee1e4 exceptionPreprocess + 180 1 libobjc.A.dylib
0x02c6d8e5 objc_exception_throw + 44 2 CoreFoundation
0x02eb4376 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 390 3 CoreFoundation 0x02ee1c29 +[NSDictionary dictionaryWithObjects:forKeys:count:] + 73 4 app 0x000ed30c ParseUserData + 428 5 app
0x0009e6e1 __37-[MenuViewController checkAuthStatus]_block_invoke + 161 6 app 0x0011f89f __82-[FirebaseSimpleLogin attemptAuthWithToken:provider:userData:account:andCallback:]_block_invoke + 461 7 app 0x00199df7 __43-[FRepo callOnComplete:withStatus:andData:]_block_invoke + 33 8
libdispatch.dylib 0x06e457b8 _dispatch_call_block_and_release + 15 9 libdispatch.dylib 0x06e5a4d0 _dispatch_client_callout + 14 10 libdispatch.dylib
0x06e48726 _dispatch_main_queue_callback_4CF + 340 11 CoreFoundation 0x02f5343e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 14 12 CoreFoundation 0x02e945cb __CFRunLoopRun + 1963 13 CoreFoundation 0x02e939d3 CFRunLoopRunSpecific + 467 14 CoreFoundation
0x02e937eb CFRunLoopRunInMode + 123 15 GraphicsServices
0x03d535ee GSEventRunModal + 192 16 GraphicsServices
0x03d5342b GSEventRun + 104 17 UIKit
0x0192df9b UIApplicationMain + 1225 18 app
0x0010623d main + 141 19 libdyld.dylib
0x0708f701 start + 1 20 ???
0x00000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException
我的代码:
Firebase *ref = [[Firebase alloc] initWithUrl:FIREBASE];
FirebaseSimpleLogin *authClient = [[FirebaseSimpleLogin alloc] initWithRef:ref];
[authClient loginWithEmail:@"useremail" andPassword:@"userPassword"
withCompletionBlock:^(NSError* error, FAUser* user) {
if (error != nil) {
NSLog(@"Success!");
// There was an error logging in to this account
} else {
NSString *message = [error.userInfo valueForKey:@"NSLocalizedDescription"];
if (message == nil) message = @"Please try again";
[self performSelectorOnMainThread:@selector(showError:) withObject:message waitUntilDone:NO];
}
}];
收到此错误,我的应用程序不再从数据库中获取数据并崩溃。有人知道吗?
最佳答案
查看堆栈跟踪。错误出在您未显示的方法 ParseUserData 中。在该方法中,您试图创建一个字典,但您传入的第一个对象是零。
在 Xcode 中,设置一个在抛出异常时触发的断点,这样下次您可以检查正在运行的程序发生了什么。
关于ios - Firebase 简单登录错误 "__NSPlaceholderDictionary initWithObjects:forKeys:count:",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23708461/
检查我的 iOS6 应用程序并尝试为 iOS7 修复所有问题。在我的整个应用程序中,我遇到了错误: -[__NSPlaceholderDictionary initWithObjects:forKey
我有以下代码: queryParams = @{@"geo_location" : [GlobalData sharedGlobalData].latLong, @"sale_ids": select
我正在尝试在 iOS 上使用电子邮件和密码进行简单登录。登录时出现以下错误。 Terminating app due to uncaught exception 'NSInvalidArgumentE
我正在使用 NSMutableUrl 请求从 .net Web 服务器获取 Web 数据。 在通过使用 NSXmlparsing 解析响应将我存储在 NSDirectory 中之后,我正在使用肥皂请求
我有一个 UITextView,我想将此文本存储在 NSDictionary 中。 我有这段代码: var imageData = UIImageJPEGRepresentation(photoIn
我正在尝试使用 Pandas UDFs (a.k.a. Vectorized UDFs)在 macOS 10.14.3 (macOS Mojave) 上的 Apache Spark 2.4.0 中。
我在 crashlytics 报告中发现了此崩溃,并且这只发生在 iPhone 7(iOS 13.*) 中。我也尝试在模拟器和真实设备中调试此崩溃,但它在我的任何设备中都没有崩溃。我不知道该怎么办才能
我收到错误 NSInvalidArgumentException 这是我的模型类 +(NSArray *)users { NSDictionary *user1 = @{@"username"
我的 Storyboard中有两个 UITextField,用于接收用户输入的数字,minPrice 和 maxPrice。当我在模拟器中点击提交时,应用程序崩溃并且我收到以下错误: Terminat
我在尝试将数据传递给 Obj-C 方法时遇到错误。 代码如图,Obj-C: RCT_EXPORT_METHOD(connect:(NSDictionary *) params) { _conn
我是一名优秀的程序员,十分优秀!