Quote:
Originally Posted by y2kreddy
Hey there
can you tell me how to do i append a string value to a UItext field.
for example :
if UItext already has value ABCDEF, and i have a string with value say, "lmonp". how do i append this string to UITEXT field value.
not all methods of nsstring can be used for uitext field. i am not able to use the stringbyappeningsting method for a uitext object, because it only responds to nsstring objects. is there any way around.
thanks.
|
mmm...google?.
However stringByAppendingString return a NSString.
Code:
NSString *string1 = @"Hello";
NSString *string2 = @"World!";
NSString *stringHW = [string1 stringByAppendingString @" "];
NSString *stringHW = [stringHW stringByAppendingString string2];
yourTextField.text = stringHW;
OR
Code:
NSString *stringHW = [NSString stringWithFormat:@"%@ %@", string1, string2];
yourTextField.text = stringHW ;