Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Receiver type 'PFLiveQueryEvent' for instance message is a forward declaration (Xcode 12 Beta 6 / Objective-C project) #230

Closed
ephread opened this issue Sep 15, 2020 · 6 comments · Fixed by #245

Comments

@ephread
Copy link
Contributor

ephread commented Sep 15, 2020

I'm having a rather strange issue. I'm not certain it's an problem with ParseLiveQuery, but before opening a radar I'd like to know if I'm the only one having the issue (I didn't find any reports matching the problem on OpenRadar).

On Xcode 12 beta 6, any time a PFLiveQueryEvent instance is accessed, the compiler is complaining. I think it extends to other types as well.

Screen Shot 2020-09-15 at 20 37 10

I investigated a bit and can't see anything wrong in the codebase. Maybe someone will have better luck.

Here is a demo project, it's just the repo with all the dependencies pre-downloaded, Parse patched with parse-community/Parse-SDK-iOS-OSX#1527 and a couple of lines added to the example project. Just open Examples/LiveQueryDemo-ObjC.xcodeproj and try to build the macOS App. It should trigger the error right away. It's a bit big, so it's available here.

Thanks for your help!

Edit: Xcode 12 GM just dropped, I'm going to check if the issue is still present.
Edit 2: Still happening with the GM, sadly.

@akmarinov
Copy link

Xcode 11 converts the PFLvieQueryEvent to:

/// Represents an update on a specific object from the live query server.
SWIFT_CLASS_NAMED("Event")
@interface PFLiveQueryEvent : NSObject
/// Type of the event.
@property (nonatomic, readonly) enum PFLiveQueryEventType type;
/// Object this event is for.
@property (nonatomic, readonly, strong) PFObject * _Nonnull object;
- (nonnull instancetype)init SWIFT_UNAVAILABLE;
+ (nonnull instancetype)new SWIFT_UNAVAILABLE_MSG("-init is unavailable");
@end

where Xcode 12 does just

@class PFLiveQueryEvent;

It feels like Apple has changed how code is converted and the ObjCCompat will have to be rewritten to be made exposable.

@ephread
Copy link
Contributor Author

ephread commented Sep 21, 2020

Following up on @akmarinov investigations, I tried multiple code permutations but I couldn't find a sensible reason explaining why PFLiveQueryEvent wouldn't be generated while PFLiveQuerySubscription is.

I tried to remove exposed properties, add new exposed methods, rename the class, shuffle code around, and so on… nothing seems to have any effect. Moving Event outside of ObjCCompat and renaming it does however solve the problem, at the cost of increasing the global namespace pollution.

It looks like a weird compiler bug, so I'm going to open a radar.

@vexelgray
Copy link

Hey @ephread!

Any news about this issue?

Regards,

@akmarinov
Copy link

@vexelgray you can use @ephread 's workaround on this fork of the repo - https://github.com/combyne/ParseLiveQuery-iOS-OSX/commits/xcode-12

until it's addressed on the main repo.

pod 'ParseLiveQuery', :git => 'https://github.com/combyne/ParseLiveQuery-iOS-OSX.git',
                          :branch => 'xcode-12'

@dplewis
Copy link
Member

dplewis commented Jan 13, 2021

@ephread Can you do a PR for this? Would love to include your fix for the community.

@ephread
Copy link
Contributor Author

ephread commented Jan 18, 2021

@dplewis Absolutely, no worries. I'll create the PR some time this week.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants