Skip to content

Commit

Permalink
Merge branch 'master' of github.com:steipete/PSFoundation
Browse files Browse the repository at this point in the history
  • Loading branch information
steipete committed Mar 2, 2011
2 parents a938cc8 + bf38da8 commit 3d0d527
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Categories/NSURL/NSURLHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@

@interface NSURL (Helper)

+ (NSURL *)URLWithStringOrNil:(NSString *)URLString;

/*
* Returns a string of the base of the URL, will contain a trailing slash
*
Expand Down
9 changes: 9 additions & 0 deletions Categories/NSURL/NSURLHelper.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@

@implementation NSURL (Helper)

+ (NSURL *)URLWithStringOrNil:(NSString *)URLString {
if (URLString) {
return [NSURL URLWithString:URLString];
}else {
return nil;
}
}


- (NSString*)baseString {
// Let's see if we can build it, it'll be the most accurate
if([self scheme] && [self host]) {
Expand Down

0 comments on commit 3d0d527

Please sign in to comment.