Created
March 19, 2009 05:29
-
-
Save maddox/81610 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSURL+Filename.h | |
// Pyrot | |
// | |
// Created by Jon Maddox on 3/19/09. | |
// Copyright 2009 Mustache, Inc.. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSURL (Filename) | |
- (NSString *)filename; | |
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSURL+Filename.m | |
// Pyrot | |
// | |
// Created by Jon Maddox on 3/19/09. | |
// Copyright 2009 Mustache, Inc.. All rights reserved. | |
// | |
#import "NSURL+Filename.h" | |
@implementation NSURL (Filename) | |
- (NSString *)filename{ | |
NSArray *components = [[self path] componentsSeparatedByString:@"/"]; | |
return [components objectAtIndex:[components count]-1]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment