I'm new to Objective-C.
[deskCalc add: 55];
NSLog(@"After adding %f to accumulator, accumulator is :%f", 55, [deskCalc accumulator]);
Some context; this is a snippet from a simple calculator program that looks fairly similar to the one found in the first post in this thread. As its name suggests, the add method add's the argument to an integer variable "accumulator", which stores the final value. Finally, the accumulator method simply returns the variable.
My question is: Rather than having to manually type the argument (55 in this case) after the string, is it possible to have code that references whichever argument is passed on to the add method (dynamically)?
I've seen other questions (such as this and this) that at least sound somewhat simlar to a noob like myself, but I haven't been able to join the dots and figure out a solution.