Thursday 15 July 2010

iphone - Objective-C NSURL URLWithString appears to fail when using variable -


After

then this is my first posting on StackOverflow, so I'm sorry if my request is not made well.

I am trying to load a variable with type NSString in an NSURL with the following line:

  Audioplayer = [[Audioplayer alloc] initPlayerWithURL: [NSURL URLWithString: aArchiveItem.streamURL] Rep: Self];  

And in the Audioplayer implementation I am using:

  - (id) initPlayerWithURL: (NSURL *) URL representative: (id & lt; AudioPlayerDelegate & gt;) aDelegate {self = [Super Init]; Delegate = one delegate; Queue = [[audioquake alooc] initQueueWithDelegate: self]; FileStream = [[audiofilestream allocess] initFileStreamWithDelegate: self]; [Open file stream]; Request = [[[AUDIOUVAVEAST] initRequestWithURL: URL Rep: Self]; Self return; }  

When I populate with a URL string (eg URLWithString: @ "") call to work hardcoded lossless Audioplayer, but when it fails prices aArchiveItem.streamURL To try ..

Am I doing wrong here?

Perhaps before you can use the URL to your url white following spaces:

  Arciveitemkstrimurl = [Arciveitemkstrimurl Stringbitrimmingcrktersinset [Nscractorset Whitspasndnevlinecrkterset]];  

No comments:

Post a Comment