0

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?

Niklas
  • 1,729
  • 1
  • 12
  • 19
  • 1
    Did you clean your working directory? This should always be done when a new beta comes out. – zisoft Sep 03 '14 at 13:21

1 Answers1

2

Make urlTest as optional, maybe NSRUL(string:) returning nil.

let urlTest: NSURL? = NSURL(string: urlString)

See answer Here.

Community
  • 1
  • 1
Allan Macatingrao
  • 2,071
  • 1
  • 20
  • 28
  • It was in fact returning `nil`. Thought it would print out `nil` then, but it needed to be optional, of course! – Niklas Sep 03 '14 at 14:17