views:

20

answers:

0

I need help with an Xcode script, and was wondering if anyone can help me solve this.

Lets say that I created these fields, "UITextField *titleField" & "UITextField *tagsField" directly within a table cell. And the "UIBarButtonItem *saveMyContentButton" below calls a function "saveMyContent". When I run the app I get the two commented errors below. I understand what the errors are but don't know the best way to fix it. I want to pass the textField values to the function. Any help would be appreciated. Thanks.

UIBarButtonItem *saveMyContentButton = [[[UIBarButtonItem alloc]
                                       initWithTitle:@"Save"
                                       style:UIBarButtonItemStyleBordered
                                       target:self
                                       action:@selector(saveMyContent:)] autorelease];

-(IBAction)saveMyContent:(id)sender {
Content *aContent = [[Content alloc] init];    
aContent.title = titleField.text; // error: 'titleField' undeclared (first use in this   function)
aContent.tags = tagsField.text; // error: 'tagsField' undeclared (first use in this function)
}