【发布时间】:2017-03-07 12:40:45
【问题描述】:
我尝试将 AppleWatch 应用程序添加到我自己的应用程序中。但我收到错误消息:找不到“UIView”的接口声明,指向我在其中定义扩展名的文件对于 UIView,如下所示(我在 pch 文件中添加了 import UIKit/UIKit.h> 代码:
UIView+KKFrameExtension.h
@interface UIView (KKFrameExtension)
@property (nonatomic,assign) CGFloat width;
@property (nonatomic,assign) CGFloat height;
@property (nonatomic,assign) CGFloat x;
@end
UIView+KKFrameExtension.m
-(CGFloat)width{
return self.frame.size.width;
}
-(void)setWidth:(CGFloat)width{
CGRect frame = self.frame;
frame.size.width = width;
self.frame = frame;
}
// height
-(CGFloat)height{
return self.frame.size.height;
}
-(void)setHeight:(CGFloat)height{
CGRect frame = self.frame;
frame.size.height = height;
self.frame = frame;
}
但是如果我删除了我的WatchApp,一切正常,那么发生了什么,我该怎么办?谢谢
【问题讨论】: