这是我的代码:
#import <UIKit/UIKit.h>
@interface CustomCellArticle: UITableViewCell
@property(nonatomic,retain) IBOutlet UILabel *name;
@end
我第一次收到此错误:
Missing @end
Expected identifier or '('
在代码的第一行中,它要求我在第一行中添加@end来修复它。
代码变成这样:
#import <UIKit/UIKit.h>
@end //here the seconde error
@interface CustomCellArticle: UITableViewCell
@property(nonatomic,retain) IBOutlet UILabel *name;
@end
添加时,我收到一个新错误:
@end must appear in an Objective-C context
我不知道到底怎么了,请帮忙!
我在另一个项目中使用了相同的类,效果很好!
最佳答案
是的,这是从另一个已经预先导入的头文件或实现文件中缺少的@end
可能是.h或.m文件
关于iphone - 缺少'@end'//@end必须出现在Objective-C上下文中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14397420/