Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

look if copyWithZone exists. This solve a different behavior between …

…simulator and device
  • Loading branch information...
commit 71bfb2f90ad97e9921ecb78ee57fa501afe128eb 1 parent e082e56
@marcosanson authored
Showing with 12 additions and 6 deletions.
  1. +12 −6 KGNoise.m
View
18 KGNoise.m
@@ -160,7 +160,10 @@ - (void) setGradienColorInternal:(NSColor *)gradienColorInternal
#endif
{
if (_gradienColorInternal != gradienColorInternal) {
- _gradienColorInternal = [gradienColorInternal copy];
+ if ([gradienColorInternal respondsToSelector:@selector(copyWithZone:)])
+ _gradienColorInternal = [gradienColorInternal copy];
+ else
+ _gradienColorInternal = gradienColorInternal;
#if TARGET_OS_IPHONE
[self setNeedsDisplay];
#else
@@ -174,16 +177,19 @@ - (void) setGradienColorExternal:(UIColor *)gradienColorExternal
#else
- (void) setGradienColorExternal:(NSColor *)gradienColorExternal
#endif
- {
- if (_gradienColorExternal != gradienColorExternal) {
+{
+ if (_gradienColorExternal != gradienColorExternal) {
+ if ([gradienColorExternal respondsToSelector:@selector(copyWithZone:)])
_gradienColorExternal = [gradienColorExternal copy];
+ else
+ _gradienColorExternal = gradienColorExternal;
#if TARGET_OS_IPHONE
- [self setNeedsDisplay];
+ [self setNeedsDisplay];
#else
- [self setNeedsDisplay:YES];
+ [self setNeedsDisplay:YES];
#endif
- }
}
+}
#if TARGET_OS_IPHONE
- (void)drawRect:(CGRect)dirtyRect{
Please sign in to comment.
Something went wrong with that request. Please try again.