How can I make FirstViewController aware of the method in the second class? I tried import and still got a warning. FirstViewController.m
#import "FirstViewController.h" #import "SecondViewController.h" -(IBAction)buttonDown:(id)sender { NSLog(@"id: %d", [sender tag] ); [SecondViewController populateTextFieldWithString:@"hey there"]; } SecondViewController.m -(void)populateTextFieldWithString:(NSString *)string { NSLog(@"%@", string ); [commandText setText:string]; } As soon as I call that method the app bombs... it has no idea what that method in the SecondViewController is... On Wed, Apr 8, 2009 at 1:27 PM, Craig Williams <cwilli...@allancraig.net>wrote: > > On Apr 8, 2009, at 11:08 AM, Eric E. Dolecki wrote: > > I have a tab bar and it's driven by FirstViewController. I have a second >> view with it's own xib. I can have buttons there call into a "buttonPress" >> method I have in the FirstViewController. I am able to get the sender tag >> easily. >> >> NSLog(@"id: %d", [sender tag] ); >> >> >> However in the second xib I have a text field that I want to populate with >> a >> string. Since the buttonPress method in the FirstViewController doesn't >> know >> about the UILabel in the SecondViewController, how can I have it set that >> field? >> >> Eric >> > > Have you considered sending the string along with the button click call and > having > the SecondViewController populate its own text field? > > -(IBAction)buttonClicked:(id)sender > { > [secondViewController populateTextFieldWithString:@"TextField > String"]; > } > > > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/edolecki%40gmail.com > > This email sent to edole...@gmail.com > -- http://ericd.net Interactive design and development _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com