URLUtils.h
changeset 24 629c7605ab2a
parent 11 e5976864dfe9
     1.1 --- a/URLUtils.h	Sat May 24 13:24:33 2008 -0700
     1.2 +++ b/URLUtils.h	Wed Apr 08 16:31:19 2009 -0700
     1.3 @@ -9,6 +9,19 @@
     1.4  #import <Foundation/Foundation.h>
     1.5  
     1.6  
     1.7 +@interface NSURL (MYUtilities)
     1.8 +
     1.9 +/** Smart/lenient version of +URLWithString:, for use with user-entered URLs.
    1.10 +    - Strips out any whitespace or newlines
    1.11 +    - Removes surrounding "<...>"
    1.12 +    - Adds a default scheme like http: if necessary, if one is provided
    1.13 +    - Checks against a list of allowed schemes, if one is provided */
    1.14 ++ (NSURL*) my_URLWithLenientString: (NSString*)string 
    1.15 +                     defaultScheme: (NSString*)defaultScheme
    1.16 +                    allowedSchemes: (NSArray*)allowedSchemes;
    1.17 +@end
    1.18 +
    1.19 +
    1.20  @interface NSHTTPURLResponse (MYUtilities)
    1.21  
    1.22  - (NSError*) HTTPError;