开发者

pData Undeclared-Objective C

I am getting an error for the below program on the data_derived.m

data_derived.m

@implementation requestSession

- (id)init {
    self=[super initWithID:ID withData:(id)pData withSize:sizeof(st)];
    if (self) {

    开发者_如何学Python}
    return self;
}
@end

data_derived.h

@interface requestSession : data {
 //declarations
}

data.h

- (id)initWithID:(int) uMessageId withData:(id)pData withSize:(size_t) uDataSize;

data.m

- (id) initWithID:(int) uMessageId withData:(id)pData withSize:(size_t) uDataSize {
 //stmts;
}


First, by convention class names start with an uppercase character.

Then, in your init there are variables named ID, pData or st. What you probably want to do is either throw an exception here (if the normal init is not to be used) or provide default values, as in:

[super initWithID:0 withData:nil withSize:0]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜