I would also like to point out in addition to dj2's answer that NSLog is a method, not an object. Objects are not initialized in the form ("param1", param2) For the NSString case, you do what dj2 did:
NSString *theAnswer = [[NSString alloc] initWithFormat:@"The answer is %@", self.answer];
Where should you declare AAnswer as an NSString pointer, because all Objective-C objects are pointers, and then again tell which class it will be allocated to (in this case NSString), then you will tell how you are going to initialize it in this case too you use initWithFormat: to initialize it.
thyrgle
source share