ios - Objective C- Import error with singleton -


this question has answer here:

i quite new on objective c please bit slow me.

i have constructed views this: viewcontroller=>root(view)=>controls(view). root singleton can root element of app time.

when add #import "root.h" controls.h parse issue.

#import <uikit/uikit.h> #import "root.h"      // triggers error  @interface controls : uiview  @end 

here root.h

#import <uikit/uikit.h> #import <foundation/foundation.h> #import "controls.h" #import "content.h"  @interface root : uiview {     controls *m_controls; // parse error: unknown type name "controls" } +(root*)getinstance; @end 

what causes that? how fix?

you use #import *.h in *.m file, when need use class in *.h use @class.

so, must change class this:

#import <uikit/uikit.h> @class root  @interface controls : uiview @end 

and in *.m file:

#import "root.h"


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -