ios - exc-bad-instruction code=i386_invop -
i'm getting error in latest version of xcode using swift 2
on line
let s = linktxt.text
text in linktxt appears button "pastefromclipboard"
let s = linktxt.text let u = nsurl(string: s!) let file = u?.lastpathcomponent
what reason of , how fix it?
update:
the problem appears in function savedata() calls when file downloading finished. calls nsurlsessiondatatask function. more interesting, in start-downloading-button there same lines filename generating , there no such error on it. fixed these issues declaring variables, writing text's values them , use these variables in savedata() except textobject.text; had delete lines nsuserdefaults savedata() because got same error. did understand nothing >_<
update 2:
it's bug. i've deleted line , wrote again - problem fixed
linktxt.txt returning nil , nsurl(string: s!) try forcefully unwrap it.
let s = linktxt.text if let s = linktxt.txt { let u = nsurl(string: s!) let file = u?.lastpathcomponent }
Comments
Post a Comment