我尝试关注 this来自作者的 github 存储库的教程,但未成功。当我尝试构建项目时,出现 6 个错误。
其中5个是
Use of undeclared identifier '_accessibleElements'
其中1个是
Receiver type 'TKCalendarMonthTiles' for instance message does not declare a method with selector 'rectForCellAtIndex'
所有错误都在 TKCalendarMonthView.m 文件中报告
最佳答案
TKCalendarMonthTiles
类似乎声明了一个属性:
@property (nonatomic, strong) NSMutableArray *accessibleElements;
这不是在类实现中合成的。由于没有声明 _accessibleElements
ivar,因此您会得到您提到的未声明的标识符错误。
对于这个错误,您可以在 Xcode 4.4 上构建以自动合成声明的属性,或者添加:
@synthesize accessibleElements = _accessibleElements
在 TKCalendarMonthTiles
实现中
现在,你的第二个错误。这也是由于基于 Xcode 4.2 而不是 4.4 构建。从 4.4(或者可能是 4.3,我不记得了)开始,您不需要在类扩展中声明私有(private)方法。但是由于您是使用 Xcode 4.2 构建的,因此您需要将方法声明添加到 TKCalendarMonthTiles
@interface TKCalendarMonthTiles ()
- (CGRect)rectForCellAtIndex:(int)index;
@end
关于iphone - 无法将 Tapku 库添加到 XCode 4.2 项目中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12451484/