Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/95.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 在主视图控制器中启动应用程序时Obj-C崩溃_Ios_Objective C_Xcode_Cocoa Touch_Parse Platform - Fatal编程技术网

Ios 在主视图控制器中启动应用程序时Obj-C崩溃

Ios 在主视图控制器中启动应用程序时Obj-C崩溃,ios,objective-c,xcode,cocoa-touch,parse-platform,Ios,Objective C,Xcode,Cocoa Touch,Parse Platform,正在寻找有关我的项目的调试帮助。我删除了额外的/注释过的代码,并且必须把一些密钥移到应用程序的基础上,因为它不再启动。p> 背景:该项目是[从教育网站TeamTreehouse复制的snapchat][1]的建设。应用程序名为Ribbit,它通过使用Parse SDK获得其后端功能 我添加了一个异常断点,当在InboxTableViewController中调用ViewWillAppeal时,似乎出现了一些错误,InboxTableViewController是启动时呈现给用户的主视图控制器 如

正在寻找有关我的项目的调试帮助。我删除了额外的/注释过的代码,并且必须把一些密钥移到应用程序的基础上,因为它不再启动。p> 背景:该项目是[从教育网站TeamTreehouse复制的snapchat][1]的建设。应用程序名为Ribbit,它通过使用Parse SDK获得其后端功能

我添加了一个异常断点,当在InboxTableViewController中调用ViewWillAppeal时,似乎出现了一些错误,InboxTableViewController是启动时呈现给用户的主视图控制器

如果有人能发现错误并指导我如何修复它,我将非常感激。据我所知,有一个问题在之后立即出现

[query whereKey:@"recipientIDs" equalTo:[[PFUser currentUser] objectId]];
该应用程序是使用Xcode版本6.4(6E35b)构建的

项目链接:


您在这条线上崩溃了:

[query whereKey:@"recipientIDs" equalTo:[[PFUser currentUser] objectId]];
崩溃的原因是
[PFUser currentUser]
在代码中返回
nil

如果您查看currentUser方法,文档会说:

/*!
 @abstract Gets the currently logged in user from disk and returns an instance of it.

 @returns Returns a `PFUser` that is the currently logged in user. If there is none, returns `nil`.
 */
+ (PF_NULLABLE instancetype)currentUser;

因此,要么登录,要么不要假定
[PFUser currentUser]
是有效的。

您在这条线上崩溃了:

[query whereKey:@"recipientIDs" equalTo:[[PFUser currentUser] objectId]];
崩溃的原因是
[PFUser currentUser]
在代码中返回
nil

如果您查看currentUser方法,文档会说:

/*!
 @abstract Gets the currently logged in user from disk and returns an instance of it.

 @returns Returns a `PFUser` that is the currently logged in user. If there is none, returns `nil`.
 */
+ (PF_NULLABLE instancetype)currentUser;

因此,要么登录,要么不要假定
[PFUser currentUser]
是有效的。

您在这条线上崩溃了:

[query whereKey:@"recipientIDs" equalTo:[[PFUser currentUser] objectId]];
崩溃的原因是
[PFUser currentUser]
在代码中返回
nil

如果您查看currentUser方法,文档会说:

/*!
 @abstract Gets the currently logged in user from disk and returns an instance of it.

 @returns Returns a `PFUser` that is the currently logged in user. If there is none, returns `nil`.
 */
+ (PF_NULLABLE instancetype)currentUser;

因此,要么登录,要么不要假定
[PFUser currentUser]
是有效的。

您在这条线上崩溃了:

[query whereKey:@"recipientIDs" equalTo:[[PFUser currentUser] objectId]];
崩溃的原因是
[PFUser currentUser]
在代码中返回
nil

如果您查看currentUser方法,文档会说:

/*!
 @abstract Gets the currently logged in user from disk and returns an instance of it.

 @returns Returns a `PFUser` that is the currently logged in user. If there is none, returns `nil`.
 */
+ (PF_NULLABLE instancetype)currentUser;



因此,要么登录,要么不要假定
[PFUser currentUser]
有效。

错误消息说什么?完整堆栈是什么?错误消息中没有真实文本:我可以看到内存地址,以及围绕*argv的一些其他消息,我不确定如何解释异常断点,找到错误行很好。但是关闭它一会儿,以获取完整的控制台日志。请将其粘贴到这里。@danh给您:argc int 1 1 argv char**0x7fff5a622290 0x00007fff5a622290*argv char*“/Users/anthony/Library/Developer/CoreSimulator/Devices/424E7654-692A-430C-A646-853ED9E6FBE1/data/Containers/Bundle/Application/517A64C5-FB26-407B-B436-4AB77985EE7A/Ribbit.app/Ribbit”0x00007fff5a622538**argv char'/'''/'错误消息说明了什么?完整堆栈是什么?错误消息中没有真实文本:我可以看到内存地址,以及围绕*argv的一些其他消息,我不确定如何解释异常断点,找到错误行很好。但是关闭它一会儿,以获取完整的控制台日志。请将其粘贴到这里。@danh给您:argc int 1 1 argv char**0x7fff5a622290 0x00007fff5a622290*argv char*“/Users/anthony/Library/Developer/CoreSimulator/Devices/424E7654-692A-430C-A646-853ED9E6FBE1/data/Containers/Bundle/Application/517A64C5-FB26-407B-B436-4AB77985EE7A/Ribbit.app/Ribbit”0x00007fff5a622538**argv char'/'''/'错误消息说明了什么?完整堆栈是什么?错误消息中没有真实文本:我可以看到内存地址,以及围绕*argv的一些其他消息,我不确定如何解释异常断点,找到错误行很好。但是关闭它一会儿,以获取完整的控制台日志。请将其粘贴到这里。@danh给您:argc int 1 1 argv char**0x7fff5a622290 0x00007fff5a622290*argv char*“/Users/anthony/Library/Developer/CoreSimulator/Devices/424E7654-692A-430C-A646-853ED9E6FBE1/data/Containers/Bundle/Application/517A64C5-FB26-407B-B436-4AB77985EE7A/Ribbit.app/Ribbit”0x00007fff5a622538**argv char'/'''/'错误消息说明了什么?完整堆栈是什么?错误消息中没有真实文本:我可以看到内存地址,以及围绕*argv的一些其他消息,我不确定如何解释异常断点,找到错误行很好。但是关闭它一会儿,以获取完整的控制台日志。请将其粘贴到这里。@danh给您:argc int 1 1 argv char**0x7fff5a622290 0x00007fff5a622290*argv char*“/Users/anthony/Library/Developer/CoreSimulator/Devices/424E7654-692A-430C-A646-853ED9E6FBE1/data/Containers/Bundle/Application/517A64C5-FB26-407B-B436-4AB77985EE7A/Ribbit.app/Ribbit”0x00007fff5a622538**argv char'/''/“不太可能”。currentUser==nil将导致objectId返回nil,并将nil传递给equalTo:,后者可能找不到任何结果,但不会崩溃。我认为我们应该等待操作粘贴错误(异常断点在错误写入控制台之前停止)。@danh查看堆栈跟踪。
equalTo:
方法正在抛出断言,可能是因为传入了
nil
。@rmaddy-是的,我现在明白了。parse sdk应该更宽容地对待nil操作数,比如
wherekeydesnotexist
。我的错。编辑后,我可以撤销我的否决票。@danh嘿danh,非常有用,但是有一个检查:
if(currentUser){
NSLog(@“currentUser:%@”,currentUser.username);
}else{
[self-performsguewithidentifier:@“showLogin”sender:self];`}所以我希望应用程序在登录时提示我登录,而不是崩溃?这有用吗?抱歉,我似乎无法将代码格式设置为工作状态。该错误内容仍然非常不透明。我想你是说有逻辑来防范零用户。如果IB中没有带有该标识符的segue(从self所指的vc出站),则会导致崩溃。或者如果在目的地的任何一个出口