Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Compiler errors on Xcode 8 #69

Closed
reidmain opened this issue Aug 12, 2016 · 3 comments
Closed

Compiler errors on Xcode 8 #69

reidmain opened this issue Aug 12, 2016 · 3 comments

Comments

@reidmain
Copy link
Contributor

card.io is failing to compile on Xcode 8 on line https://github.com/card-io/card.io-iOS-source/blob/master/Classes/CardIOVideoStream.mm#L267

The problem is that the the cardIOPaymentViewControllerForResponder: method is defined as + (CardIOPaymentViewController *)cardIOPaymentViewControllerForResponder:(UIResponder *)responder. So it is expecting a UIResponder * as the parameter.

https://github.com/card-io/card.io-iOS-source/blob/master/Classes/CardIOVideoStream.mm#L267 is calling CardIOPaymentViewController *vc = [CardIOPaymentViewController cardIOPaymentViewControllerForResponder:self.delegate]; and self.delegate is defined as @property(nonatomic, weak, readwrite) id<CardIOVideoStreamDelegate> delegate; so it is not guaranteed to be a UIResponder *.

I honestly have no idea how this currently compiles on Xcode 7 but apparently the compiler has been updated for Xcode 8 and is now catching this.

I think you can just update CardIOVideoStream.h to be @property(nonatomic, weak, readwrite) UIResponder<CardIOVideoStreamDelegate> *delegate; and then this compiler error will go away. It looks like the CardIOCameraView is the only thing that uses CardIOVideoStream and it is a subclass of UIView which is a UIResponder.

@josharian
Copy link
Member

Thanks. Send a PR?

@reidmain
Copy link
Contributor Author

Sure, I'll try to get some up now.

@reidmain
Copy link
Contributor Author

Fixed by merging in #70

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

No branches or pull requests

2 participants