UIColor expected a type after update to xCode 7.3

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 14:36:23

问题


My project stop to compile after was updated to 7.3 version. For this moment main problem is in header files when I want to return UIColor. xCode tells me Expected a type error. Is there some way to handle with this situation?

Edit: my code (nothing special)

#import <Foundation/Foundation.h>

@interface NSString (Color)

- (UIColor *)rgbColor; //Expected a type
- (UIColor *)hexColor; //Expected a type

@end

回答1:


You should import uikit if you are using UIColor.




回答2:


Use

@class UIColor;

above @interface.

It'll fix the expected a type error.



来源:https://stackoverflow.com/questions/36514045/uicolor-expected-a-type-after-update-to-xcode-7-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!