Hi All,
its taking me longer to work this out than i thought and its driving me nuts i have to keep asking these stupid and simple questions...
i have a simple for loop, and all i want todo is output an appended string to NSLog with the following info (eventually its going to populate an array instead. what i want to get showing in NSLog is
entry 1
entry 2
entry 3
but thanks to me not knowing how todo this i get
entry
entry
entry
heres my loop
now i know im going wrong on the FinalString append line i just cannot workout how to append an int to an NSString, am i going about this the wrong way? as i tried to use an NSNumber object for the loop but i got even more errors from the For loop at that point.
its taking me longer to work this out than i thought and its driving me nuts i have to keep asking these stupid and simple questions...
i have a simple for loop, and all i want todo is output an appended string to NSLog with the following info (eventually its going to populate an array instead. what i want to get showing in NSLog is
entry 1
entry 2
entry 3
but thanks to me not knowing how todo this i get
entry
entry
entry
heres my loop
Code:
NSMutableString *finalStringValue =[[NSMutableString alloc] init];
for (n = 1; n <= 3; n++)
{
[finalStringValue setString:@"entry "];
[finalStringValue appendString:n];
NSLog(finalStringValue);
}
[finalStringValue release];
now i know im going wrong on the FinalString append line i just cannot workout how to append an int to an NSString, am i going about this the wrong way? as i tried to use an NSNumber object for the loop but i got even more errors from the For loop at that point.