开发者

Import from view

开发者 https://www.devze.com 2023-02-03 13:50 出处:网络
im working on an app, where i have a Tableview in firstView, and i have a textfield in another .xib.now loading xib by pushing a button, is no problem,but how to i add text from the textfield in one x

im working on an app, where i have a Tableview in firstView, and i have a textfield in another .xib. now loading xib by pushing a button, is no problem, but how to i add text from the textfield in one xib to the tableview in the firstView.xib ???

can any of you help og give me a link to so开发者_运维知识库me help :-D

Rene Skov


Here's a link that should help you: CLICK HERE

The best way to do what your wanting to do is to save the text in your textview in a plist or directory since what your working with is small. Then you would need to read from the plist or directory and input into your tableview on your other view. That's how I would do it but there's probably a better way. Good Luck and I how that link helps. :-)

Edit: Oops, I thought you said textview but it's a textfield that your working with. Hummm, since it's just a textfield I would use NSUserDefaults to store the data that is in your textfield.

You would save and read the textfield like so:

NSUserDefaults *textDefault = [NSUserDefaults standardUserDefaults];

[textDefault setObject:yourTextFieldName.text forKey:@"someName"];

NSString *textValue= [textDefault objectForKey:@"someName"];

NSLog(@"Your Text -->%@",textValue);

I hope this helps.

0

精彩评论

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