Skip to content
Browse files

Merge pull request #121 from nheagy/master

Small fix to my last pull request
  • Loading branch information...
2 parents e3c9aaf + 01e8b4b commit 1da49a1b660b81f56da605fbb17b9861b65d8ffe Allen Ding committed Apr 19, 2012
Showing with 9 additions and 2 deletions.
  1. +5 −2 Kiwi/KWIntercept.m
  2. +4 −0 Kiwi/KWSpec.m
View
7 Kiwi/KWIntercept.m
@@ -159,8 +159,11 @@ void KWSetupMethodInterceptSupport(Class interceptClass, SEL aSelector) {
Class KWRestoreOriginalClass(id anObject) {
Class interceptClass = object_getClass(anObject);
- Class originalClass = class_getSuperclass(interceptClass);
- anObject->isa = originalClass;
+ if (KWClassIsInterceptClass(interceptClass))
+ {
+ Class originalClass = class_getSuperclass(interceptClass);
+ anObject->isa = originalClass;
+ }
return interceptClass;
}
View
4 Kiwi/KWSpec.m
@@ -52,6 +52,10 @@ - (NSString *)description
NSArray *words = [name componentsSeparatedByString:@" "];
name = @"";
for (NSString *word in words) {
+ if ([word length] < 1)
+ {
+ continue;
+ }
name = [name stringByAppendingString:[[word substringToIndex:1] uppercaseString]];
name = [name stringByAppendingString:[word substringFromIndex:1]];
}

0 comments on commit 1da49a1

Please sign in to comment.
Something went wrong with that request. Please try again.