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

Generic parameter 'T' could not be inferred #3

Closed
umangoo opened this issue Aug 22, 2019 · 1 comment
Closed

Generic parameter 'T' could not be inferred #3

umangoo opened this issue Aug 22, 2019 · 1 comment

Comments

@umangoo
Copy link

umangoo commented Aug 22, 2019

When I call this code : let exampleArray_get = try! StorageManager.default.arrayValue("exampleArray")
I get a error : Generic parameter 'T' could not be inferred
How to fix it
ps: Xcode version 10.3, swift 5.0
ths

@iAmrSalman
Copy link
Owner

Hello @umangoo,
you should assign StorageManager.default.arrayValue("exampleArray") to a variable/constant to be able to infer your array type or at least cast it
for example:
let stringArray: [String] = try StorageManager.default.arrayValue("exampleArray")
or try StorageManager.default.arrayValue("exampleArray") as [String]

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

2 participants