Skip to content

PFUser subclass fails on 1.14.0 #975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
batkov opened this issue Jul 15, 2016 · 15 comments
Closed

PFUser subclass fails on 1.14.0 #975

batkov opened this issue Jul 15, 2016 · 15 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@batkov
Copy link

batkov commented Jul 15, 2016

Hi,

After update to 1.14.0 I'm experiencing constant crash when trying to work with subclass of PFUser.

Actually there is no subclass:
[MyUser currentUser] returns PFUser instance

After I rolled back to 1.13.0 everything works as is.

@batkov
Copy link
Author

batkov commented Jul 15, 2016

I do following after didFinishLaunching

[MyUser registerSubclass];
[Parse initializeWithConfiguration:]

@nlutsenko
Copy link
Contributor

@batkov, does your MyUser class conform to PFSubclassing?
There is a requirement on this, where the classes are not registered automatically, unless they expose the fact that they conform to PFSubclassing, which is a required step for making subclasses of PFObject/PFUser/PFInstallation.

@parse-github-bot
Copy link

Thank you for your feedback. We prioritize issues that have clear and concise repro steps. Please see our Bug Reporting Guidelines about what information should be added to this issue.

Please try the latest SDK. Our release notes have details about what issues were fixed in each release.

In addition, you might find the following resources helpful:

@CiraciNicolo
Copy link

Confirmed broken, I've subclassed PFUser as User and I get this error:
-[PFUser isComplete]: unrecognized selector sent to instance 0x7faf08c8a4e0
isComplete is a custom field in my subclass.

@CiraciNicolo
Copy link

@nlutsenko If MyUser subclass PFUser, you can't redefine the PFSubclassing implementation.

@nlutsenko
Copy link
Contributor

@iStopped, you can't redefine the implementation, but you can declare the fact that you conform to PFSubclassing, which is a requirement for PFObject/PFUser/PFInstallation subclasses.
I've just tested the following MyUser implementation and it works like a charm:

MyUser.h

#import <Parse/Parse.h>

@interface MyUser : PFUser <PFSubclassing>

@property (nonatomic, assign) BOOL isComplete;

@end
MyUser.m

#import "MyUser.h"

@implementation MyUser

@dynamic isComplete;

@end
AppDelegate.m

NSLog(@"%@", [MyUser currentUser]);
NSLog(@"%@", [[MyUser currentUser] class]);
NSLog(@"%d", [[MyUser currentUser] isComplete]);

@nlutsenko
Copy link
Contributor

The whole thing here is that you shouldn't be required to, you are right.
I am going to send a patch in few minutes that fixes this altogether without a need for workaround.

@nlutsenko nlutsenko self-assigned this Jul 15, 2016
@nlutsenko nlutsenko added type:bug Impaired feature or lacking behavior that is likely assumed and removed needs more info labels Jul 15, 2016
@CiraciNicolo
Copy link

@nlutsenko I'm talking about swift, you can't do that in swift. Sorry for the misunderstanding

@nlutsenko
Copy link
Contributor

1.14.1 is live now (you might want to run pod repo update if you are using CocoaPods for dependency management).
Would be great if you guys could validate that all of this works now.

@CiraciNicolo
Copy link

It is working, thanks. 👍

@acegreen
Copy link

@nlutsenko Crashalytics says 800+ crashes on my beta build yet I never experienced any. Are these hard crashes? Also I never subclass anything, does PFUser use this class?

screen shot 2016-07-18 at 9 17 12 am

@acegreen
Copy link

acegreen commented Jul 18, 2016

@nlutsenko Even after updating to 1.14.1 the issue resurfaces. No actual crash though, but crashalytics seems to catch something.

@acegreen
Copy link

acegreen commented Jul 18, 2016

It seems to happen multiple times in an instance because only Apple bots have this beta under review and now crashes are 943

@acegreen
Copy link

acegreen commented Jul 18, 2016

Well over a 1k now and this is just from Apple bots and myself. Whats going on here

screen shot 2016-07-18 at 12 29 19 pm

@acegreen
Copy link

acegreen commented Jul 18, 2016

Just one last note: the version on my actual device with the same 1.14.1 doesn't experience any crash reports. Only the bots seem to cause issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

5 participants