I'm at the next part of the book but my code is not working. It says that I can take a line of code that looks like this [numGuess setNumber : input]; and do this instead numGuess.setNumber = input;
The first version works in the [] brackets, but the DOT Operator is not working and I get the error.... " REQUEST FOR MEMBER 'setNumber' IN SOMETHING NOT A STRUCTURE OR UNION.
The first version works in the [] brackets, but the DOT Operator is not working and I get the error.... " REQUEST FOR MEMBER 'setNumber' IN SOMETHING NOT A STRUCTURE OR UNION.
Code:
#import "test_instance.h"
int input;
int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
test_instance *numGuess = [[ test_instance alloc]init];
NSLog(@"Pick a number:");
scanf("%i", &input);
numGuess.setNumber = input;
[numGuess print];
[pool drain];
return 0;
}