Skip to content

Instantly share code, notes, and snippets.

@atomicbird
Created March 4, 2010 00:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atomicbird/321253 to your computer and use it in GitHub Desktop.
Save atomicbird/321253 to your computer and use it in GitHub Desktop.
--- Color4.h ---
@interface Color4 : NSObject {
}
-(id) initWithRed:(float)red green:(float)green blue:(float)blue alpha:(float)alpha;
@end
--- Color4.m ---
#import "Color4.h"
@implementation Color4
-(id) initWithRed:(float)red green:(float)green blue:(float)blue alpha:(float)alpha {
self = [super init];
return self;
}
@end
--- Light.h ----
#import <Foundation/Foundation.h>
@class Color4;
@interface Light : NSObject {
Color4* color;
}
@property (nonatomic, retain) Color4* color;
-(id) init;
@end
--- Light.m ---
#import "Light.h"
#import "Color4.h"
@implementation Light
@synthesize color;
-(void) dealloc {
[ color release ];
[ super dealloc ];
}
-(id) init {
if( self = [ super init ] ) {
color = (Color4 *) [ [ Color4 alloc ] initWithRed:1.0f green:1.0f blue:1.0f alpha:1.0f ];
}
return self;
}
@end
------
warning: incompatible Objective-C types assigning 'UIColor*', expected 'Color4*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment