我的 .h 类中有以下内容:
extern CGFloat tableMarginSide;
extern CGFloat tableMarginTop;
extern CGFloat fromImageSize;
extern CGFloat keyboardHeightPortrait;
extern CGFloat keyboardHeightLandscape;
在我的初始化中我做了:
CGFloat tableMarginSide = 20;
CGFloat tableMarginTop = 20;
CGFloat fromImageSize = 50;
CGFloat keyboardHeightPortrait = 210;
CGFloat keyboardHeightLandscape = 160;
if (IS_IPAD){
CGFloat tableMarginSide = 80;
CGFloat tableMarginTop = 65;
CGFloat fromImageSize = 50;
CGFloat keyboardHeightPortrait = 260;
CGFloat keyboardHeightLandscape = 350;
}
为什么我收到警告并且我不能在课堂上使用这个浮点数?哦,顺便说一句,我不想使用预处理器