objective c - Using string in different class -


i have simple question passing parameters between classes.

i have uitextfield in class a, filled nsstring - "stringa" want use string in different class, class b. but, want set text (from string) in uitextfield on class b, press button change viewa viewb. how manage that? don't it.

edit:

viewa.h

@interface staedteviewcontroller : uiviewcontroller <uipickerviewdelegate, uipickerviewdatasource, uitextfielddelegate> {   iboutlet uitextfield *textfield1; }   @property(nonatomic,retain) uitextfield *textfield1;  -(ibaction)staedtebestaetigen:(id)sender;  @end 

viewa.m

@implementation staedteviewcontroller  @synthesize picker, textfield1;   - (ibaction)staedtebestaetigen:(id)sender {      preiseingabeviewcontroller *preiseingabeview = [[[preiseingabeviewcontroller alloc] init] autorelease];     preiseingabeview.textfield1.text = textfield1.text;      [self presentmodalviewcontroller:preiseingabeview animated:yes]; }     -(void)viewdidload {      self.textfield1.text = @"sometext";  } - (void)viewdidunload {     [super viewdidunload];     self.textfield1 = nil;  }  - (void)dealloc {     [textfield1 release];      [super dealloc];  } 

viewb.h

@interface preiseingabeviewcontroller : uiviewcontroller <uitextfielddelegate> {  iboutlet uitextfield *textfield1;     nsstring *text; }  @property(nonatomic,retain) uitextfield *textfield1; @property (retain, nonatomic) nsstring *text; @end 

viewb.m

@synthesize textfield1;   - (nsstring *)text {     return self.textfield1.text; }  - (void)settext:(nsstring *)value {     textfield1.text = value; }  - (void)viewdidunload {     [super viewdidunload];     self.textfield1 = nil; 

i set textfield via ib

make uiviewcontroller contains both views. link action controller , when action fired, value of first textfield , put second text field.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -