0

can anyone help solve this error when running xcode with the following code and trying to nslog url1

.m file

        NSLog(@"URL flag is not set, Reverting to stored value");
//url1 = [NSURL URLWithString: [NSString stringWithFormat: @"http://radio.qkradio.com.au:8382/listen.mp3"]];
        url1 = [NSURL URLwithString:@"http://radio.qkradio.com.au:8382/listen.mp3"];
        NSLog(url1);

.h file

NSURL *url1;

error

2013-04-14 09:18:41.958 iQkradio[61530:4803] REACHABLE!
2013-04-14 09:18:41.990 iQkradio[61530:c07] Application windows are expected to have a root view controller at the end of application launch
2013-04-14 09:18:42.569 iQkradio[61530:4803] URL flag is not set, Reverting to stored value
2013-04-14 09:18:42.570 iQkradio[61530:4803] +[NSURL URLwithString:]: unrecognized selector sent to class 0x1ef926c
2013-04-14 09:18:42.570 iQkradio[61530:4803] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSURL URLwithString:]: unrecognized selector sent to class 0x1ef926c'
Ossama
  • 2,401
  • 7
  • 46
  • 83

2 Answers2

0

You have a typo in your code. The correct code is:

url1 = [NSURL URLWithString:@"http://radio.qkradio.com.au:8382/listen.mp3"];

Notice that the "W" is uppercase, as mentioned here. Hope this helps!

Sagito
  • 1,036
  • 1
  • 12
  • 31
0

As others have mentioned, you need to use URLWithString:.

But there is more. Try formatting your log like this NSLog(@"%@",url1);

Jeff Wolski
  • 6,332
  • 6
  • 37
  • 69