I need to create a string in Xcode that I can keep adding to every time a calculation is performed within a function.
if(answer != 0) answer1 = [NSString stringWithFormat:@"%d / %d = %d \n", answer, number[i], myans];
return 1;
I need the 'answer1' value to ammend itself after each true if statement. for example :-
first correct statement :-
answer1 now equals "10 / 5 = 2 \n"
second correct answer :-
answer1 now needs to equal "10 / 5 = 2 \n 200 / 10 = 20 \n"
and so on until the loop finishes.
The value of the string has to be available outside of the function.