Created
March 4, 2010 00:34
-
-
Save atomicbird/321253 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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