Page 47. createDate


#1

Hi.

I´m stuck at page 47 in the book. When I’m typing the:

Possession *p = [[Possession alloc] init];
NSLog(@"%@ %@ %@ %d", [p possessionName], [dateCreated],
[p serialNumber], [valeInDollars]);

an error pops up, saying: Use of undeclared identifier 'dateCreated’
How do I fix it? :slight_smile:

Sorry its maybe a stupid question, but I’m all new to programming.


#2

[quote=“greenlantern00”]Hi.

I´m stuck at page 47 in the book. When I’m typing the:

Possession *p = [[Possession alloc] init];
NSLog(@"%@ %@ %@ %d", [p possessionName], [dateCreated],
[p serialNumber], [valeInDollars]);
[/quote]
This line should be

NSLog(@"%@ %@ %@ %d", [p possessionName], [p dateCreated], [p serialNumber], [p valueInDollars]);

Note: Your valueInDollars is misspelled. Maybe you have mispelled dateCreated somewhere else in the code. Just noticed, also the p is missing before dateCreated (and valueInDollars)

[quote=“greenlantern00”]
an error pops up, saying: Use of undeclared identifier 'dateCreated’
How do I fix it? :slight_smile:

Sorry its maybe a stupid question, but I’m all new to programming.[/quote]


#3

Thanks for the answer, after a time I did notice the things you said, so now it works just fine :slight_smile:
Thanks again!