简体   繁体   中英

I am getting this error while calling an API - “Thread 1: EXC_BAD _INSTRUCTION(code = EXC_1386_INVOP,subcode = 0*0)”

Consider:

图片

I am getting this error while calling the API:

Thread 1: EXC_BAD _INSTRUCTION(code = EXC_1386_INVOP,subcode = 0*0)

The main thing is getting the error in the alamofire.swift file.

If you look closely, your error says:

fatal error: unexpectedly found nil while unwrapping an optional value

Which means, that a variable that wasn't supposed do be nil , is nil .

In this code NSURL(URL: URLString.URLString) returns nil .

Check again what URL are you passing as parameter.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM