Wednesday, May 1, 2013

NSURL standardizedURL example ios


Returns a new NSURL object with any instances of ".." or "." removed from its path.
- (NSURL *)standardizedURL
Return Value of [NSURL standardizedURL]
A new NSURL object initialized with a version of the receiver’s URL that has had any instances of".." or "." removed from its path.
Example of [NSURL standardizedURL]
NSString *s  = @"";
NSURL    *u  = [NSURL URLWithString:s];
NSURL    *su = [u standardizedURL];
NSLog(@"su: %@", su);
Example of [NSURL standardizedURL]
MPMoviePlayerViewController *Mpplayer =[[MPMoviePlayerViewController alloc] initWithContentURL: [url standardizedURL]];
Mpplayer.moviePlayer.movieSourceType = MPMovieSourceTypeUnknown;  
[self presentModalViewController:Mpplayer animated:YES];
[[Mpplayer moviePlayer] play];