Add multiple text in textField without rewriting old entries?
I want to add multiple text value in text field. The values comes from different different views. But when i go开发者_高级运维 to next view and select some text value from second view and come to first view the value replaces the old value of text field. How can i maintain the old textfield value with new one and show both values in same textfield.
Thanks in advance.
i would try something like this , make nsmutable string and textfield value will be nsmutable string , so when user goes to other view just append in string and always show value in textfield from mutable string
good luck
when you move to next page then store the textfield value to a string variable and when you come back append the new text to previous one and set it to textfield
in first view .h
NSString *textfieldValue;
@property (nonatomic, retain) NSString *textfieldValue;
in first view .m file
@ synthesize textfieldValue;
In the controller owning the first view add a NSString *displayedText variable.
When changing the text, do
[displayedText stringByAppendingString:@"secont_text"];
]
精彩评论