Skip to content
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

Method doesn't override any method from its superclass #1526

Closed
ompagi opened this issue Sep 22, 2016 · 20 comments
Closed

Method doesn't override any method from its superclass #1526

ompagi opened this issue Sep 22, 2016 · 20 comments

Comments

@ompagi
Copy link

ompagi commented Sep 22, 2016

screen shot 2016-09-22 at 10 41 39 am

I have some issue with the function i commented. If i uncomment it, it comes up with the doesn't override issue.
Tried to delete the override keyword and it comes up with .../Pods/Charts/Source/Charts/Utils/ChartPlatform.swift:111:21: Method 'touchesCancelled(:withEvent:)' with Objective-C selector 'touchesCancelled:withEvent:' conflicts with method 'touchesCancelled(:withEvent:)' from superclass 'UIResponder' with the same Objective-C selector

@danielgindi
Copy link
Collaborator

Compiling for macOS?

@ompagi
Copy link
Author

ompagi commented Sep 22, 2016

@danielgindi Compiling for Iphone IOS

@vaibhav-varshaaweblabs
Copy link

I'm having the same issue

@NoIf728
Copy link

NoIf728 commented Sep 23, 2016

I'm having the same issue compiling for Iphone IOS

@danielgindi
Copy link
Collaborator

What version of Xcode are you using?

@NoIf728
Copy link

NoIf728 commented Sep 23, 2016

@danielgindi Xcode 7.3.1 and Xcode 8.0 both try

@danielgindi
Copy link
Collaborator

You should compile Charts 3.0 only on the latest Xcode 8.0 (not beta!)

@ompagi
Copy link
Author

ompagi commented Sep 23, 2016

@danielgindi What's the version for Xcode 7.3 and Swift 2.2

@NoIf728
Copy link

NoIf728 commented Sep 23, 2016

@danielgindi Charts 2.3.0 has same issue

@liuxuan30
Copy link
Member

@ompagi Chart 2.2.5 with release tags.

@liuxuan30
Copy link
Member

@K24LFY what methods are reporting this? From what I worked on the migration, it looks like you are using wrong code base so you see such issues.

@pmairoldi
Copy link
Collaborator

It looks like you are using cocoapods from the screenshot. So I tested it. I tried all combinations of swift/objective-c project and they all work when using the most recent release (2.3.0). Charts 3.0 is not release so if you have integration problems then you will have to wait until 3.0 is released or always use the most recent code from master.

@ankitkapasi
Copy link

I am having this same problem.

Xcode 8
pod 'Charts', git: 'https://github.com/danielgindi/Charts.git', branch: 'Chart2.2.5-Swift2.3'

        public final override func touchesCancelled(touches: Set<NSUITouch>, withEvent event: NSUIEvent?)
        {
            self.nsuiTouchesCancelled(touches, withEvent: event)
        }

Build Error: Method does not override any method from its superclass.

If I remove the override, then it says Overriding declaration requires an 'override' keyword

@pmairoldi
Copy link
Collaborator

Ya i'm gonna delete stale branches those are not up to date. You should be using pod 'Charts', '~> 2.3' for swift 2.3

@ankitkapasi
Copy link

@petester42 thanks. Will do.

@boontong
Copy link

boontong commented Oct 11, 2016

Hi,
I have tried the methods above, on Xcode 8, using Swift 2.3, updated pod as 2.3 also but still gets this:
“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly.

Not too sure where I am missing
My own codes has been converted to 2.3 using Xcode, but I did not pick Charts frame work in the prompt (for auto convert)

image


I downloaded a separate copy of XCode 7.3.1, to open up my original project, using pod 'Charts', '~> 2.3'

I get the "Method does not override any method from its superclass" problem

Quite confused what is missing

@pmairoldi
Copy link
Collaborator

Try using version 1.1.0 of cocoapods for better Xcode 8 support. 1.0.0 has issues with Xcode 8

@BigRiceDad
Copy link

Same issue here. Xcode 7.3.1 Swift 2.2, pod 2.3.0

@andrey-16
Copy link

Faced the same issue in one old project written in Swift 2.3 and compiled by XCode 7.3.1.

The issue is that "touchesCancelled" overrides method of UIResponder class:
public func touchesCancelled(touches: Set?, withEvent event: UIEvent?)

And mistakenly (or not) has the "touches" parameter not as optional as required by the function declaration of UIResponder.
Correcting the "touches: Set" to "touches: Set?" helps to resolve the issue. Though I'm not sure if it can introduce other incompatibility issues with earlier versions of CocoaTouch. I'm not sure when exactly Apple changed the declaration of touchesCancelled.

@DanH-SyncInteractive
Copy link

Try changing:
public final override func touchesCancelled(touches: Set<NSUITouch>, withEvent event: NSUIEvent?)

to

public final override func touchesCancelled(touches: Set<NSUITouch>?, withEvent event: NSUIEvent?)

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

No branches or pull requests