NSString(KoboldKit) Category Reference
Declared in | NSString+KoboldKit.h |
Class Methods
replaceOccurancesOfString:withString:inFile:encoding:
Replaces occurances of string in a text file. Does nothing if file does not exist. File is written atomically.
+ (NSString *)replaceOccurancesOfString:(NSString *)search withString:(NSString *)replace inFile:(NSString *)file encoding:(NSStringEncoding)encoding
Parameters
- search
The string to search for.
- replace
The string to replace occurances of ‘search’ with.
- file
The file (with optional path) in which to replace strings.
- encoding
The NSStringEncoding used by the file.
Return Value
Returns the file contents with search string occurances replaced, or nil if there was an error in input or reading the file.
Declared In
NSString+KoboldKit.h
Instance Methods
color
String converted to SKColor object. The string must be in the form “1.0 1.0 1.0 1.0” where the values stand for the RGBA color values in the same order.
- (SKColor *)color
Return Value
String converted to SKColor object. The string must be in the form “1.0 1.0 1.0 1.0” where the values stand for the RGBA color values in the same order.
Declared In
NSString+KoboldKit.h
containsString:
Performs a case sensitive search for a substring. Returns YES if the string contains the substring.
- (BOOL)containsString:(NSString *)subString
Parameters
- subString
The sub string to search for.
Return Value
YES if the subString is contained in the string.
Declared In
NSString+KoboldKit.h
pointValue
A CGPoint converted from a string point representation like “{300, 400}”.
- (CGPoint)pointValue
Return Value
A CGPoint converted from a string point representation like “{300, 400}”.
Declared In
NSString+KoboldKit.h
rectValue
A CGRect converted from a string rect representation like “{{10, 20}, {300, 400}}”.
- (CGRect)rectValue
Return Value
A CGRect converted from a string rect representation like “{{10, 20}, {300, 400}}”.
Declared In
NSString+KoboldKit.h
sizeValue
A CGSize converted from a string size representation like “{10, 20}”.
- (CGSize)sizeValue
Return Value
A CGSize converted from a string size representation like “{10, 20}”.
Declared In
NSString+KoboldKit.h
stringByDeletingIllegalFileSystemCharacters
Removes illegal filesystem characters from the string.
- (NSString *)stringByDeletingIllegalFileSystemCharacters
Return Value
The string with all illegal file system characters removed.
Declared In
NSString+KoboldKit.h
stringByDeletingIllegalXcodeCharacters
Removes characters from the string that are illegal to use in .xcodeproj bundle and related files.
- (NSString *)stringByDeletingIllegalXcodeCharacters
Return Value
The string with all illegal .xcodeproj characters removed.
Declared In
NSString+KoboldKit.h