简体   繁体   English

解析iOS-XCode6:使用情节提要的AnyPic中的PFUser对象出现问题

[英]Parse iOS-XCode6: problems with PFUser objects from AnyPic using storyboards

I am Trying to add the USER structure from AnyPic tutorial into my app. 我正在尝试将AnyPic教程中USER结构添加到我的应用中。 I had several problems compiling the project on XCode6. 在XCode6上编译项目时遇到了几个问题。

Finally I solved all of them (arm64 architectures problems, MBProgressHUD, TTTTimeIntervalFormatter, ParseSDK framework, etc..) and I got all the classes I need on my app without compile errors. 最终,我解决了所有这些问题(arm64架构问题,MBProgressHUD,TTTTimeIntervalFormatter,ParseSDK框架等),并且在我的应用程序上获得了所需的所有类,而没有编译错误。

I've implemented a FB Login structure on my main View Controller, so I didn't use the Parse Facebook Login methods (I didn't import in my project Login methods and classes). 我已经在主View Controller上实现了FB Login结构,所以我没有使用Parse Facebook Login方法(我没有导入我的项目Login方法和类)。

I am interested on the USER structure with Fb profile picture, following/followers methods and view controllers for Account Settings and Timeline, basically the 2 classes PAPAccountViewController and PAPHomeViewController both subclasses of PAPPhotoTimelineViewControllers . 我感兴趣的使用FB资料图片的用户结构,帐户设置和时间线,基本上是2类PAPAccountViewControllerPAPHomeViewController PAPPhotoTimelineViewControllers的两个子类以下/追随者方法和视图控制器。 PAPPhotoTimelineViewController never displayed on its own, but rather inherited by the main timeline and the user account view controllers. PAPPhotoTimelineViewController从未单独显示,而是由主时间轴和用户帐户视图控制器继承。

MAIN PROBLEM: 主要问题:

AnyPic do not use Storyboards and I can't handle with PFUser *user object because I didn't understand where the USER initialization is. AnyPic 不使用情节提要,并且我无法使用PFUser * user对象处理,因为我不知道USER初始化在哪里。

I am trying to connect the PAPAccountViewController in a TableViewController on my Storyboard. 我正在尝试在Storyboard上的TableViewController中连接PAPAccountViewController This is the error I get: 这是我得到的错误:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'user cannot    be nil'
*** First throw call stack:
(0x185a67100 0x1924441fc 0x185a67040 0x1000941b4 0x188a30658 0x188a303dc 0x188bdd850 0x188ae7f3c     0x188ae7d0c 0x188ae7c8c 0x188a2afe0 0x18861c258 0x188616e20 0x188616cd8 0x188616560 0x188616304 0x188a2f154 0x185a277f4 0x185a26b50 0x185a24de8 0x185965dd0 0x18b605c0c 0x188a96fc4 0x1000dfffc 0x192a37aa0)
libc++abi.dylib: terminating with uncaught exception of type NSException

// PAPAccountViewController.m // PAPAccountViewController.m

- (void)viewDidLoad {
[super viewDidLoad];

if (!self.user) {
    [NSException raise:NSInvalidArgumentException format:@"user cannot be nil"];
}

In order to Test if something shows up I also did a reference from the TableViewController on my storyboard to the superclass "PAPPhotoTimelineViewControllers", which is a subclass of PFQueryTableViewController , and it worked fine. 为了测试是否出现了什么,我还从情节提要上的TableViewController引用了超类“ PAPPhotoTimelineViewControllers”,它是PFQueryTableViewController的子类,并且工作正常。

An empty TableViewController load after running, and I think it'ok because the class never displayed on its own. 运行后将空的TableViewController加载,我认为这是可以的,因为该类从不单独显示。

But nothing load for PAPAccountViewController. 但是,PAPAccountViewController不会加载任何内容。

How can I solve this? 我该如何解决? I do not have users on my Parse Database and it obviously throws the exception, but I couldn't find where the PFUser object is initialized. 我的Parse数据库上没有用户,显然它引发了异常,但是我找不到PFUser对象的初始化位置。

  • Maybe the PFUser object comes from the Login Fb with Parse? 也许PFUser对象来自使用Parse的Login Fb? I tried to use Parse for Facebook login before but it doesn't work for XCode6. 我曾尝试使用Parse进行Facebook登录,但不适用于XCode6。

  • Does my way to proceed with Storyboards make sense? 我进行情节提要的方式有意义吗?

Here it is the tutorial and the link for the code: https://parse.com/tutorials/anypic 这是教程和代码的链接: https : //parse.com/tutorials/anypic

问题解决了,我找到了自己的解决方案,方法是针对Xcode6优化Anypic教程,然后采用带有代码视图和类的情节提要!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM