And some refactoring (writing a base class for two distinct classes + a few other things) , my project failed to compile on ipad , not works fine on simulator
/Users/.../PaintViewController.m:50: error: 'width' undeclared (first use in this function)
/Users/.../PaintViewController.m:59: error: 'backgroundView' undeclared (first use in this function)
of course, these variables are declared (in the new base class) , and the 2 classes inherets from the base class
any ideas why ? I imported the base class as well.
class where the errors takes place:
#import "PaintViewControllerBase.h"
@class PopupSaveDrawingController;
@interface PaintViewController : PaintViewControllerBase
{
MenuBarViewController *menuBarView;
bool bBarIsOpened;
bool bIsClosing;
bool bIsOpening;
float fBarY;
NSTimer *toggleTimer;
NSArray *toolBrushImgArray;// liste des textures de brosses
PopupSaveDrawingController *popupSaveDrawning;
}
base class:
@interface PaintViewControllerBase : UIViewController
{
// Handle Move ///
CGPoint location;
CGPoint previousLocation;
BOOL firstTouch;
// Size ///
NSInteger width;
NSInteger height;
// Actions
UndoRedoManager *undoManager;
toolType currentToolType;
// Brush
PaintBrush *brush;
PaintImage *image;
// image buffer //////
NSMutableData *data;
// GUI
PaintCanvas *backgroundView;
PaintCanvas *modeleView;
PaintCanvas *drawView;
}
statement that failed to compile :
width = [PaintMenuViewController width]; // error here on ipad target only
height = [PaintMenuViewController height];// error here on ipad target only
CGRect rect = CGRectMake(0,0,width,height);
self.view = [[UIView alloc] initWithFrame:rect];
/**********************
* IMAGEVIEW BACKGROUND
**********************/
backgroundView = [[PaintCanvas alloc] initWithFrame:rect]; // error here on ipad target only
the problem seems to disapear if I add self before each variable eg : self.width = 1024, but I would prefer not to do this (there is a lot of stuff to change)