Browse Source

Support bridging from UIColor to CGColorRef in the selector performing utility method.

Ryan Olson 12 years ago
parent
commit
59a6150ed8
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Classes/Utility/FLEXRuntimeUtility.m

+ 4 - 0
Classes/Utility/FLEXRuntimeUtility.m

@@ -310,6 +310,10 @@ const unsigned int kFLEXNumberOfImplicitArgs = 2;
             if (typeEncodingCString[0] == @encode(id)[0] || typeEncodingCString[0] == @encode(Class)[0]) {
                 // Object
                 [invocation setArgument:&argumentObject atIndex:argumentIndex];
+            } else if (strcmp(typeEncodingCString, @encode(CGColorRef)) == 0 && [argumentObject isKindOfClass:[UIColor class]]) {
+                // Bridging UIColor to CGColorRef
+                CGColorRef colorRef = [argumentObject CGColor];
+                [invocation setArgument:&colorRef atIndex:argumentIndex];
             } else if ([argumentObject isKindOfClass:[NSValue class]]){
                 // Primitive boxed in NSValue
                 NSValue *argumentValue = (NSValue *)argumentObject;