0
I’m a beginner in language Objective C
and I was practicing, when I got some errors, follow the code:
@interface Pessoas: NSObject
{
int idade;
int peso;
}
-(void) imprimir;
-(void) setIdade: (int) i;
-(void) setPeso: (int) p;
@end
@implementation Pessoas
-(void) imprimir{
NSLog(@"Meu nome é Lucas, eu tenho %i anos e %i quilos", idade, peso);
}
-(void) setIdade:(int) i{
idade = i;
}
-(void) setPeso:(int) p{
peso = p;
}
@end
int main(int argc, const char * argv[]){
@autoreleasepool {
Pessoas = lucas;
lucas = [[Pessoas alloc] init];
[lucas setIdade:19];
[lucas setPeso: 66];
[lucas imprimir];
}
return 0;
}
List of Errors:
Parse Issue Expected Identifier or '('
Semantic Issue Use of undeclared Identifier 'Ucas'
Semantic Issue Missing '[' at start of message send Expression
Semantic Issue Use of undeclared Identifier 'Lucas' (3x)
Which error?
– Laerte
The first eh: Parse Issue Expected Identifier or '(' / in the rest: Semantic Issue - Use of undeclared idenfier 'Lucas'
– Lucas Castellani
@Lucascastellani Report errors specifically in the question, so it’s easier for Sopt users to help you better. Any doubt read How to ask a good question at the aid plant
– Caputo
@Caputo Pardon, I detailed the errors in the question.
– Lucas Castellani
@Lucascastellani No need to apologize, we are a community and we are here for mutual help.
– Caputo