diff options
Diffstat (limited to 'Source/SPStringAdditions.h')
-rw-r--r-- | Source/SPStringAdditions.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Source/SPStringAdditions.h b/Source/SPStringAdditions.h index c6871e2a..7c0bfb90 100644 --- a/Source/SPStringAdditions.h +++ b/Source/SPStringAdditions.h @@ -101,3 +101,17 @@ static inline id NSMutableAttributedStringAttributeAtIndex(NSMutableAttributedSt */ - (BOOL)nonConsecutivelySearchString:(NSString *)other matchingRanges:(NSArray **)submatches; @end + +@interface NSMutableString (SPStringAdditions) +/** + * nil-safe variant of setString: + * nil will be interpreted as @"" instead of throwing an exception + */ +- (void)setStringOrNil:(NSString *)aString; + +/** + * nil-safe variant of appendString: + * nil will be interpreted as @"" instead of throwing an exception + */ +- (void)appendStringOrNil:(NSString *)aString; +@end |