User Tools

Site Tools


Programming Reference/Librarys

Question & Answer

Q&A is closed



   - (NSString *)stringByAppendingFormat:(NSString *)format, …   

Returns a string made by appending to the receiver a string constructed from a given format string and the following arguments.

ObjC Sourcecode Example

    for(int a=0; a<5; a++)
	    NSString *cycle=@"Pass";
            cycle=[cycle stringByAppendingFormat:@"%i", a];
            NSLog(@"%@", cycle);

Output for this example code

2012-04-15 12:14:53.335 FoundationNSString[649:403] Pass0
2012-04-15 12:14:53.339 FoundationNSString[649:403] Pass1
2012-04-15 12:14:53.340 FoundationNSString[649:403] Pass2
2012-04-15 12:14:53.341 FoundationNSString[649:403] Pass3
2012-04-15 12:14:53.342 FoundationNSString[649:403] Pass4

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
objective-c/foundation.framework/nsstring.h/stringbyappendingformat.txt · Last modified: 2024/02/16 01:12 (external edit)

Impressum Datenschutz