Skip to content
This repository has been archived by the owner on Jul 5, 2019. It is now read-only.

API.swift get "Initializer for conditional binding must have Optional type, not '[Rule]'" error #46

Closed
wenewzhang opened this issue Sep 20, 2017 · 7 comments

Comments

@wenewzhang
Copy link

i have update to Xcode 9,try compile Potatso and get the error:
Initializer for conditional binding must have Optional type, not '[Rule]'
if (JSONToMap != nil) { if let parsedObject = Mapper<T>().mapArray(JSONArray: JSONToMap as! [[String : Any]]){ return .success(parsedObject) } }

Thanks

@wenewzhang
Copy link
Author

i delete the if let ,change to let,
compile success,

@adteven
Copy link

adteven commented Sep 22, 2017

swift convert on xcode9?

@wenewzhang
Copy link
Author

if let parsedObject = Mapper().mapArray(JSONArray: JSONToMap as! [[String : Any]]){ return .success(parsedObject) }
change to
let parsedObject = Mapper().mapArray(JSONArray: JSONToMap as! [[String : Any]])
return .success(parsedObject)

@adteven
Copy link

adteven commented Sep 22, 2017

xcode 9
/Users/cuiboqiang/Desktop/workspace/git/sswork/Potatso2/Pods/Realm/Realm/ObjectStore/src/results.cpp:281:28: No viable overloaded '='

@wenewzhang
Copy link
Author

pod update fix this

@JeansHuang
Copy link

JeansHuang/Potatso Work for Xcode9.1 iOS11.1 Swift3.2

@haxpor
Copy link
Owner

haxpor commented Dec 25, 2017

Updated to support xcode 9.2. Feel free to re-open this issue if you still face the problem.

@haxpor haxpor closed this as completed Dec 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants