objective c - How to silence 'Expected a type' Xcode compiler warnings? -
this question has answer here:
- forward-declare enum in objective-c 5 answers
is there way silence xcode compiler warnings because of unknown types @class? defined type in single .h file can reused throughout app:
#ifndef apsiape_interfacedefinitions_h #define apsiape_interfacedefinitions_h #define color_alert_red [uicolor colorwithred:1 green:0.3 blue:0.3 alpha:1] ... typedef enum { byedgetypenone = 0, byedgetypetop, byedgetypeleft, byedgetypebottom, byedgetyperight } byedgetype; #endif
and 1 of classes uses byedgetype
type custom protocol in .h file:
#import <uikit/uikit.h> @protocol bypullscrollviewdelegate <nsobject> - (void)pullscrollview:(uiscrollview*)pullscrollview didscrolltopage:(nsinteger)page; - (void)pullscrollview:(uiscrollview*)pullscrollview diddetectpullingatedge:(byedgetype)edge; @end
i want interfacedefinitions.h
file in .m file of class, if don't import in .m of class xcode (of course) complains "expected type" (byedgetype). how can silence warning @class-style?
thanks in advance
is protocol defined in header (.h
) file? if so, use enums , #defines
in .h file, you'll have import header definitions in .h
file.
Comments
Post a Comment