• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Undocumented NSString API
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Undocumented NSString API


  • Subject: Undocumented NSString API
  • From: Norbert Heger <email@hidden>
  • Date: Tue, 16 Oct 2001 23:04:35 +0200

I just discovered a bunch of quite useful (or at least useful sounding) but
unfortunately undocumented NSString methods. May we expect some of these
methods to become part of the official API one day, or do we have to
reinvent the wheel?

Best Regards, Norbert

_____________________________________________
Norbert Heger, Objective Development
http://www.obdev.at/





@interface NSString (Undocumented)

- (BOOL)isCanonical;
- (BOOL)isCaseInsensitiveLike:(id)object;
- (BOOL)isLike:(id)object;
- (BOOL)matchesPattern:(id)aPattern;
- (BOOL)matchesPattern:(id)aPattern caseInsensitive:(BOOL)flag;

- (id)mutableSubstringFromRange:(NSRange)aRange;

- (NSRange)significantText;

- (NSString *)stringByAddingPercentEscapes;
- (NSString *)stringByConvertingPathToURL;
- (NSString *)stringByConvertingURLToPath;
- (NSString *)stringByRemovingPercentEscapes;
- (NSString *)stringWithoutAmpersand;

- (NSString *)canonicalString;
- (NSString *)displayableString;
- (NSString *)quotedStringRepresentation;

- (NSString *)standardizedNativePath;
- (NSString *)standardizedURLPath;
- (NSString *)urlPathByAppendingComponent:(NSString *)component;
- (NSString *)urlPathByDeletingLastComponent;
- (NSString *)urlPathRelativeToPath:(NSString *)path;

- (NSString *)lowercaseStringWithLanguage:(NSString *)aLanguage;
- (NSString *)uppercaseStringWithLanguage:(NSString *)language;
- (NSString *)capitalizedStringWithLanguage:(NSString *)language;


- (NSRange)_rangeOfPrefixFittingWidth:(float)width withFont:(NSFont *)font;
- (NSRange)_rangeOfSuffixFittingWidth:(float)width withFont:(NSFont *)font;
- (NSRange)_rangeOfSuffixFittingWidth:(float)width
withAttributes:(id)attributes;
- (NSRange)_rangeOfPrefixFittingWidth:(float)width
withAttributes:(id)attributes;
- (unsigned int)_endOfParagraphAtIndex:(unsigned int)anIndex;


- (BOOL)_getFSRefForApplicationName:(FSRef *)ref;
- (BOOL)_getFSRefForPath:(FSRef *)ref;
- (BOOL)_getFSRefForServiceName:(FSRef *)ref;
- (BOOL)_getFSSpecForPath:(FSSpec *)spec;
- (BOOL)_getVRefNumForPath:(short *)vref;
+ (NSString *)_pathForFSRef:(FSRef *)ref;

@end



@interface NSMutableString (Undocumented)

- (void)_deleteAllCharactersFromSet:(NSSet *)aSet;

- (void)_replaceAllAppearancesOfString:(NSString *)aString
withString:(NSString *)aString;

- (void)_replaceFirstAppearanceOfString:(NSString *)aString
withString:(NSString *)aString;

- (void)_replaceLastAppearanceOfString:(NSString *)aString
withString:(NSString *)aString;

- (void)appendCString:(const char *)aString length:(int)aLength;

- (void)appendCharacter:(unsigned short)aCharacter;

- (void)appendCharacters:(const unsigned short *)characters
length:(int)aLength;

- (void)deleteLastCharacter;

- (void)insertString:(NSString *)aString atIndex:(unsigned int)anIndex;

- (void)replaceCharactersInRange:(NSRange)aRange
withCString:(const char *)cString length:(unsigned int)length;

- (void)replaceCharactersInRange:(NSRange)aRange
withCharacters:(const unsigned short *)characters
length:(unsigned int)length;

- (void)trimWhitespace;

@end


  • Follow-Ups:
    • [OFF] Services Question - X.1
      • From: James Bredijk <email@hidden>
    • Re: Undocumented NSString API
      • From: Matthew Formica <email@hidden>
  • Prev by Date: Re: Changing Desktop picture from Cocoa app in 10.1 without re-starting Finder
  • Next by Date: Re: Beginner's questions
  • Previous by thread: Newbie Multiple Doc Question
  • Next by thread: Re: Undocumented NSString API
  • Index(es):
    • Date
    • Thread