objective c - #if for device detection in iPhone SDK -
i'm curious why code won't work:
#if ui_user_interface_idiom//() == uiuserinterfaceidiompad @implementation uinavigationbar (custom height) - (cgsize)sizethatfits:(cgsize)size { cgsize newsize = cgsizemake(self.frame.size.width,44+breadcrumbbarheight-1); return newsize; } @end #endif
any ideas?
ui_user_interface_idiom() macro designed (and defined) runtime evaluation! using compile-time evaluation fail.
it defined as:
#define ui_user_interface_idiom() ([[uidevice currentdevice] respondstoselector:@selector(userinterfaceidiom)] ? [[uidevice currentdevice] userinterfaceidiom] : uiuserinterfaceidiomphone)
the call [uidevice.. fail @ compile-time evaluation
Comments
Post a Comment