I'm using XCode4.4DP2. Anyway the warnings below won't show up in XCode4.3.1.
/Users/zhaojianyin2012/Dev/DTCoreText/Core/Source/NSScanner+HTML.h:11:1: Redefinition of forward class 'DTColor' of a typedef name of an object type is ignored
/Users/zhaojianyin2012/Dev/DTCoreText/Core/Source/DTHTMLElement.h:13:1: Redefinition of forward class 'DTColor' of a typedef name of an object type is ignored
/Users/zhaojianyin2012/Dev/DTCoreText/Core/Source/NSString+CSS.h:9:1: Redefinition of forward class 'DTColor' of a typedef name of an object type is ignored
Maybe you can come up with a better way to do that. I am only doing this typedef because I need DTColor to be UIColor on iOS and NSColor on Mac.
Maybe there's another order of imports and typedef that fixes this warning?
I'm not sure, maybe separate the API by using this?
But this will split all related code and probably not a good idea.
Or add another head file to contain all the forward decl, like DTCoreTextForwardDecl.h and add it to the .pch file?
Maybe just don't bother with this warning, seems not a big deal.
All Objective-C compilers as far as I know all support the @compatability_alias directive, used like @compatibility_alias DTColor UIColor. A bit more robust than a #define, more compatible than a subclass, safer than casting to id, and more language-safe than a typedef. It's all up to you, though.
@compatibility_alias DTColor UIColor
EDIT: The 4.4 compiler also seems to crack down some on casts for string formats; at DTCSSListStyle.m:246, 0x%x should be %p and in NSString+HTML.m:689 %C should be %d, according to this.
replaced typedef for DTColor/DTImage with @compatibility_alias
this should fix a compiler warning
fixed two format specifier compiler warnings. #147
please test if the two fixes I pushed are fixing the issue.
Zero warnings in XCode 4.4 DP2 now!
Hooray! Thanks for your help!