您的位置:首页 > 移动开发 > IOS开发

IOS : Missing context for method declaration Error

2012-09-16 17:39 411 查看
#import "UIVaryColorLabel.h"
@implementation UIVaryColorLabel
#import <QuartzCore/QuartzCore.h>
#import <CoreText/CoreText.h>

- (id)initWithFrame:(CGRect)frame 此处报错为Missing context for method declaration
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}

其实这个错误很简单就可以修改过来,主要是蓝色部分代码@implementation UIVaryColorLabel代码应该放到#import的后面,问题就解决了。
正确代码如下:

#import "UIVaryColorLabel.h"
#import <QuartzCore/QuartzCore.h>
#import <CoreText/CoreText.h>
@implementation UIVaryColorLabel
- (id)initWithFrame:(CGRect)frame
{
self = [super
initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐