0

I'm trying to develop a new static library using Xcode 3.2.3.

Xcode is giving strange error messages show below in my G.h file. What is the cause of these errors?

Charles

#import <Foundation/Foundation.h>
#import <CoreGraphics/CoreGraphics.h>
#import <UIKit/UIKitDefines.h>

@interface G : NSObject {
  int fontSize, canvasWidth, canvasHeight;
}

UIColor *lightslategray;  
  error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token

@property int fontSize, canvasWidth, canvasHeight;

-(void) DrawLine:(float)x1 :(float)y1 :(float)x2 :(float)y2 :(float) lineWidth: (UIColor *)color;
  error: expected ')' before 'UIColor'

@end
ThinkingStiff
  • 64,767
  • 30
  • 146
  • 239
CBrauer
  • 1,035
  • 2
  • 11
  • 17

1 Answers1

0

Your code should probably look like:

#import <UIKit/UIKit.h>

@interface G : NSObject {
  int fontSize, canvasWidth, canvasHeight;
  UIColor *lightslategray;  
}

@property (nonatomic, assign) int fontSize;
@property (nonatomic, assign) int canvasWidth;
@property (nonatomic, assign) int canvasHeight;

-(void) drawLine: (float)x1 y1:(float)y1 x2:(float)x2 y2:(float)y2 lineWidth:(float) lineWidth color: (UIColor *)color;

@end

It's your first Objective C program ever, isn't it?

Codo
  • 75,595
  • 17
  • 168
  • 206
  • Yes, I am new to Objective-c development. However, your code gives the same error messages. My original code compiles and runs fine when it is part of an application. The error occurs only when I try to move this code to a static library project. There must be something else wrong. – CBrauer Aug 26 '10 at 22:50