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

Serious compile issues #31

Closed
TarangKhanna opened this issue Mar 8, 2015 · 7 comments
Closed

Serious compile issues #31

TarangKhanna opened this issue Mar 8, 2015 · 7 comments

Comments

@TarangKhanna
Copy link

The error is: unknown>:0: error: could not build Objective-C module 'OAuthSwift'
It works and suddenly it gives this error on build. I have tried this on 3 different laptops and the solution to clean build and delete derived data does not work all the time. Sometimes it shows one error(aforementioned) or it shows 21 errors
We spent over 4 hours with apple engineers on this in a hackathon with no progress.
Thank you for your work!

@danshev
Copy link

danshev commented Mar 15, 2015

I believe related:

When I open the Demo in the newest version of xCode 6.2 (6C131e), I also get a lot of compile errors. Many are in the OAuth1 and OAuth2 due to the use of as!. When I remove the exclamation, the errors go away, except for a few:

Cannot downcast from 'UIViewController?' to non-@objc protocol type 'WebViewProtocol'

on the line:

if let webView = self.webViewController as WebViewProtocol {

@Chrisell
Copy link

Same issues here. Xcode Version 6.2 (6C131e) as well. I'm assuming the master build has been upgraded for Xcode6.3/iOS 8.3, hence the errors?

@ramki1979
Copy link

How to build this with 6.1.1, I am getting the following errors for length & size methods in String+OAuthSwift.swift

'String' is not convertible to 'Range<I>'

Update: Use https://github.com/WazzeZ/OAuthSwift fork for xcode 6.1 and 6.2

@gabriel-jones
Copy link

SUPPORT FOR BEFORE SWIFT 1.2

There are a few main types of errors. First, the down casting he does looks like this:
as! String
Which will make an error. What you have to do is write this:
as String!


Next error is what danshev said:
if let webView = self.webViewController as? WebViewProtocol
Has an error. Easiest way to fix this is to go to OAuthWebViewController.swift and find this piece of code on line 13:
protocol WebViewProtocol
and change it to:
@objc protocol WebViewProtocol


Next error is what ramki1979 said: there are some string errors in some files. One you can fix is this:
if count(queryString.utf16) == 0
Just change it to a property, not a function:
if queryString.utf16Count == 0

Bascially, if you ever see
count(stringName.utf16)
Just change it to
stringName.utf16Count

Also another example under String+OAuthSwift.swift you will find this:
func length()->Int{ return count(self) }

which should just return:
return self.utf16Count


Hope I helped you guys. Tell me if I missed anything!

@ejpusa-zz
Copy link

Ok, almost@ Down to 1 error, tried a number of permutations, still bugs out. Thanks for all your help gabriel-jones.
screen shot 2015-04-11 at 4 07 53 pm

@ejpusa-zz
Copy link

Got it! Thanks. Looks clean. Wow, lots of crazy code, what books do you read? This code seems pretty hardcore, how do you keep up with it? Blogs, sites, coders you follow? :-)

screen shot 2015-04-11 at 4 13 59 pm

@phimage
Copy link
Member

phimage commented Sep 29, 2015

@TarangKhanna please close this old github issue
(only you or project owner can do it)

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

7 participants