开发者

Add multiple text in textField without rewriting old entries?

开发者 https://www.devze.com 2023-02-22 13:32 出处:网络
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 firs

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"]; ]

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号