I have a button in a test iPhone0 application that opens StackOverflow questions based on their GET ID in the URL. Every time the button is pressed, the page should reload to the next question.
I keep count of the GET ID through a int count
initially set to 1 and incremented every button press.
Hard-coding the URL using: NSString *urlAddress=[NSString stringWithFormat:@"http://stackoverflow.com/questions/1"];
works, but obviously doesn't allow for use of the counter. When I try to implement the counter with:
NSString *urlAddress =[NSString stringWithFormat: @"http://stackoverflow.com/questions/%@", count];
The program fails with the OBJC_MSGSEND error. Why does this line of code not work?
*I have debugged and this is the first line that causes said error.
Thanks.