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

swift tutorial => OHMySQLContainer.shared() doesn't work #10

Closed
xiaosean opened this issue Mar 5, 2018 · 5 comments
Closed

swift tutorial => OHMySQLContainer.shared() doesn't work #10

xiaosean opened this issue Mar 5, 2018 · 5 comments
Assignees

Comments

@xiaosean
Copy link

xiaosean commented Mar 5, 2018

What did you do?

The following line of code in the tutorial doesn't work!
It is swift version in the select part

let response = try? OHMySQLContainer.shared().mainQueryContext?.executeQueryRequestAndFetchResult(query)

shared() will cause compile error!
Hint:
Cannot call value of non-function type 'OHMySQLContainer'
Replace '()' with ''

What happened instead?

If i use the following line,
It can compile but no response.

         let response = try?OHMySQLContainer.shared.mainQueryContext?.executeQueryRequestAndFetchResult(query)

Now, I use the following line, can use!

let response = try? context.executeQueryRequestAndFetchResult(query)

But i don't think it is a well behavior.

What did you expect?

Please revise the tutorial, thanks!

OHMySQL Environment

  • **OHMySQL version:**2.1.3
  • **Xcode version:**9.2
  • Swift version: *(if applicable, if not remove)*4.03
  • **Platform(s) running OHMySQL:**ios
@oleghnidets
Copy link
Owner

Thanks for reporting.
I will revise all related documentation.

@oleghnidets
Copy link
Owner

Done! 🍻

@estella98
Copy link

Thank you @xiaosean so much. My friend and I have been trying to fix this issue for a long time until we see your post. and we have browsed all the documentations and still see the old, wrong request. are you sure you update it? @oleghnidets

@oleghnidets
Copy link
Owner

@estella98 My bad. But I guess Xcode' auto-completed should help write a code. Don't you use Xcode?

@estella98
Copy link

I do use Xcode. but it does not give me any auto finish recommendation as usual when I am using ohmysql.

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

No branches or pull requests

3 participants