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

1.6.0 let store = try Store(directoryPath: directory.path) 这个方法不能使用? #52

Closed
624990742 opened this issue May 27, 2021 · 6 comments
Labels
question Further information is requested

Comments

@624990742
Copy link

我使用的是1.6.0,我在使用的时候用这个方法创建“let store = try Store(directoryPath: directory.path)”会报错误
Incorrect argument labels in call (have 'directoryPath:', expected'model:directory:maxDbSizeInKByte:fileMode:maxReaders:readOnly:')这个是怎么回事?

@624990742 624990742 added the bug Something isn't working label May 27, 2021
@greenrobot
Copy link
Member

Could you try to translate to English, please?

@624990742
Copy link
Author

I use 1.6.0. When I use this method to create "let store = try store (directorypath: directory. Path)", an error will be reported Incorrect parameter label in call (with 'directorypath:', expected 'model: directory:maxDbSizeInKByte :fileM ode:maxReaders What's the matter with this?

@greenrobot
Copy link
Member

Thanks for your effort. It is covered by this FAQ.

@greenrobot greenrobot added question Further information is requested and removed bug Something isn't working labels Jun 8, 2021
@marcocebrian
Copy link

marcocebrian commented Sep 19, 2021

@greenrobot I am facing the exact same issue here.

The project compiles perfectly with just one entity defined.

  • Compiled n number of times and tried clean-and-build. Nothing.
    Tested with CocoaPods and SPM getting the same result.

Could you give an insight on things to check? With a perfectly compiled project, it is still complaining for the same reason the moment I add the line:

let store = try Store(directoryPath: directory.path)
Xcode: 12.5.1

Thanks!

@marcocebrian
Copy link

So, I realised I missed one step using CocoaPods and now it is working fine.
I am noting it down in case it helps someone else:

As per the documentation, you have to execute a second step. A ruby script after pod install:
Pods/ObjectBox/setup.rb

@greenrobot-team
Copy link
Member

As for the original issue:

When I use this method to create "let store = try store (directorypath: directory. Path)", an error will be reported Incorrect parameter label in call (with 'directorypath:', expected 'model: directory:maxDbSizeInKByte :fileM ode:maxReaders What's the matter with this?

This means the generated Store initializer is missing, which accepts the directoryPath argument. Make sure that the project is set up correctly and build at least once to generate code. I added an explicit step (similar to our main docs) for this: https://swift.objectbox.io/getting-started#generate-objectbox-code

Closing this issue due to inactivity. 💤 Feel free to comment with more details or submit a new issue.

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

No branches or pull requests

4 participants