需要添加 #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> 转载于:https://www.cnblogs.com/SimonGao/p/5098335.html