Posted By

gfazioli on 07/14/10


Tagged

iphone ipod iPad


Versions (?)

getFilenameFromRequest


 / Published in: ActionScript 3
 

URL: http://www.undolog.com

Get a filename part from a NSURLRequest. Optionally remove extension

  1. - (NSString *)getFilenameFromRequest:(NSURLRequest *)request avoidExtension:(BOOL)avoidExtension {
  2. NSString *filePath = [[[request URL] path] lastPathComponent];
  3. if (avoidExtension) {
  4. NSArray *a = [filePath componentsSeparatedByString:@"."];
  5. return [a objectAtIndex:0];
  6. }
  7. return filePath;
  8. }

Report this snippet  

You need to login to post a comment.