Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use of undeclared identifier self [closed]

I created a class named Data parsing and in this class, I laid out three functions:

The first is getData(), and it needs to call parseLine().

I am calling the parseLine() method like so:

[self parseline];

However, I am receiving the following error:

Sse of undeclared identifier 'self'

How are my functions in this class suppose to call each other?

void getData(NSString *data) { 
    while(temp_top < [data length]) { 
        icc_data[++data_top] = [data characterAtIndex:temp_top]; 
        if (icc_data[data_top]==')' && icc_data[data_top -1]=='\031') { } 
        if (icc_data[0]!='\031' && icc_data[data_top]=='\n') { 
            [dataParsing parseLine]; 
        }
    }
}
like image 991
LanternMike Avatar asked Oct 08 '12 23:10

LanternMike


1 Answers

You are implementing void getData(NSString *data) as a C function. Functions do not get a reference to self. Use a method instead:

- (void)data
{
}
like image 97
Nikolai Ruhe Avatar answered Nov 15 '22 04:11

Nikolai Ruhe