From 7c1b9b4d155bfef42bf798422384b6a6cfd1d963 Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Thu, 15 Mar 2018 14:09:14 +0000 Subject: [PATCH] fix style errors --- Headers/Foundation/NSAttributedString.h | 4 ++-- Source/NSAttributedString.m | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Headers/Foundation/NSAttributedString.h b/Headers/Foundation/NSAttributedString.h index 3b98e1213..28a7890ce 100644 --- a/Headers/Foundation/NSAttributedString.h +++ b/Headers/Foundation/NSAttributedString.h @@ -74,8 +74,8 @@ extern "C" { - (NSUInteger) length; /** Returns the string content of the receiver.
* NB. this is actually a proxy to the internal content (which may change) - * so if you need an immutable instance yu should copy the returned value, - * not jhust retain it. + * so if you need an immutable instance you should copy the returned value, + * not just retain it. */ - (NSString*) string; //Primitive method! diff --git a/Source/NSAttributedString.m b/Source/NSAttributedString.m index b7d9dd93b..3c1fe8def 100644 --- a/Source/NSAttributedString.m +++ b/Source/NSAttributedString.m @@ -243,7 +243,9 @@ appendUIntData(NSMutableData *d, NSUInteger i) if (![aDecoder containsValueForKey: @"NSAttributeInfo"]) { - NSDictionary *attributes = [aDecoder decodeObjectForKey: @"NSAttributes"]; + NSDictionary *attributes; + + attributes = [aDecoder decodeObjectForKey: @"NSAttributes"]; self = [self initWithString: string attributes: attributes]; } else @@ -550,7 +552,8 @@ appendUIntData(NSMutableData *d, NSUInteger i) if (NSMaxRange(rangeLimit) > [self length]) { [NSException raise: NSRangeException - format: @"RangeError in method -attribute:atIndex:longestEffectiveRange:inRange: in class NSAttributedString"]; + format: @"RangeError in method %@ in class %@", + NSStringFromSelector(_cmd), NSStringFromClass([self class])]; } if (attributeName == nil) @@ -745,7 +748,9 @@ appendUIntData(NSMutableData *d, NSUInteger i) if (![aDecoder containsValueForKey: @"NSAttributeInfo"]) { - NSDictionary *attributes = [aDecoder decodeObjectForKey: @"NSAttributes"]; + NSDictionary *attributes; + + attributes = [aDecoder decodeObjectForKey: @"NSAttributes"]; self = [self initWithString: string attributes: attributes]; } else