Reputation: 1777
So, today I downloaded and installed the latest beta of Xcode 6 (beta 7), released yesterday. As per usual, I got bunch of compiling errors due to changes in the program, but nothing major and all fixed within 5 min.
Now, however, I get a Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)
when trying to do a simple println()
on a NSURL
. Have tried on the following NSDATA
as well, with the same error.
This is my simple code:
let urlTest: NSURL = NSURL(string: urlString)
println(urlTest)
urlString
contains the URL to a JSON result and is tested fully valid.
So my question is; is there an obvious error in my simple code (quite new to iOS development and of course Swift) or is this some kind of annoying bug in beta 7?
Upvotes: 0
Views: 2893
Reputation: 2101
Make urlTest
as optional, maybe NSRUL(string:)
returning nil.
let urlTest: NSURL? = NSURL(string: urlString)
See answer Here.
Upvotes: 2