在我的应用程序中,我有一个Entry表单,其中有六个Text字段
In my application I have one Entry form in which there are six Text fields
现在我想要的是我希望所有这些字段的值都在其他ViewController类的相同字段中.怎么可能.
Now What I want is that I want all these fields value in the same fields of other ViewController class. How it could be possible .
请帮助我,我真的需要帮助.
Please help me I really need help for this..
特别鸣谢
推荐答案您可以通过在委托类中实现getter和setter来实现.
You can achieve that by implementing getter and setters in the delegate class.
在代理.h文件中
包括UIApplication委托
Include UIApplication delegate
@interface DevAppDelegate : NSObject <UIApplicationDelegate> NSString * currentTitle; - (void) setCurrentTitle:(NSString *) currentTitle; - (NSString *) getCurrentTitle;在Delegate实现类.m
In Delegate implementation class .m
-(void) setCurrentLink:(NSString *) storydata{ currentLink = storydata; } -(NSString *) getCurrentLink{ if ( currentLink == nil ) { currentLink = @"Display StoryLink"; } return currentLink; }因此,要评估的变量是通过setters方法和要在其中放置字符串的类在currentlink字符串中设置的,只需使用getter方法即可.
So the variable you to assess is set in the currentlink string by setters method and class where you want the string ,just use the getter method.
更多推荐
iPhone:如何从另一个控制器类访问View控制器类中的数据?
发布评论