ios - Objective-C: Expected a type error -
i trying follow tutorial using stylesheet nick kuh's book "iphone app development". stylesheet header file throwing:
"expected type"
errors think reflects circular problem. however, in case import foundation.h. (the implementation file, btw, not throw errors , seems fine.) here header file in entirety.
#import <foundation/foundation.h> typedef enum : int { idlabeltypename = 0, idlabeltypebirthdaydate, idlabeltypedaysuntilbirthday, idlabeltypedaysuntilbirthdaysubtext, idlabeltypelarge } idlabeltype; @interface idstylesheet : nsobject +(void)initstyles; +(void)stylelabel:(uilabel *)label withtype:(idlabeltype)labeltype;//throws red error +(void)styletextview:(uitextview *)textview;//throws red error +(void)styleroundcorneredview:(uiview *)view;//throws red error @end
can see why these errors occurring?
uilabel
, uitextview
... defined in uikit framework, therefore have to
#import <uikit/uikit.h>
(which implicitly imports foundation). can use more modern "module" syntax:
@import uikit;
Comments
Post a Comment