Re: sudden errors
Re: sudden errors
- Subject: Re: sudden errors
- From: Roland King <email@hidden>
- Date: Tue, 28 Feb 2012 18:01:08 +0800
you're importing AppController.h in ViewManager.h and vice-versa, I assume you just added that, or just put the ViewController instance inside AppController. So when you import ViewController it imports AppController (before ViewController is defined) which doesn't reimport ViewController (because you were already importing it) and so ViewController isn't defined when you use it.
Pretty common error.
Move the ViewController import into the AppController.m file and put
@class ViewController;
instead.
On Feb 28, 2012, at 5:21 PM, H. Miersch wrote:
>
> On 28. Feb 2012, at 0:54, Keary Suska wrote:
>
>> Are you saying that you have not made any changes whatsoever to the project in any way, nor did you change the version of Xcode you were using, but you get a slew of errors when you clean/compile?
>
> i was editing Viewmanager.m, and .h, but i didn't go anywhere near that outlet or import statement. i was trying to get a method to work the way i want it to work. and suddenly, from one build to the next, i get the errors. i was using xcode 4.3 when the errors appeared, and because i thought something was screwed up in 4.3, (wouldn't be the first time) i went back to 4.2.1, but that didn't help :-(
>
>
>> Otherwise, in most cases, it is programmer error. Are the error messages you quote the *only* errors and warnings you are getting?
>
> nope, i get the following errors (and i think the first is the root)
>
> Unknown type name 'ViewManager'
>
> Property with 'retain (or strong)' attribute must be of object type
>
>
>
> here's my viewmanager.h
>
> //
> // ViewManager.h
> //
>
> #import <Foundation/Foundation.h>
> #import <Cocoa/Cocoa.h>
> #import <AppController.h>
>
> @interface ViewManager : NSObject {
> BOOL logScale, compAxis;
> NSDate *date, *firstDate;
> double min, max, hLW;
> double a, b, x1,x2;
> }
>
>
>
> @property double height;
> @property double rightMargin;
> @property double leftMargin;
> @property double topMargin;
> @property double bottomMargin;
> @property double lineWidth;
> @property BOOL logAxis;
> @property BOOL compressedAxis;
>
> @property (retain) NSColor *backgroundColor;
> @property (retain) NSColor *bearColor;
> @property (retain) NSColor *bullColor;
> @property (retain) NSColor *axisColor;
> @property (retain) IBOutlet AppController *controller;
> @property (retain) NSDate *date;
> @property (retain) NSDate *firstDate;
>
> -(void)resetMargins;
> //-(double)getXFromIndex:(int)currentIndex;
>
> @end
>
> in my AppController.h i have
>
> #import "ViewManager.h"
>
> and further down
>
> @property (retain) IBOutlet ViewManager *viewManager;
>
> and this is one of the lines that get the errors. the other 2 lines are in another .m file, but they get the same errors.
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden