pass string to table cell view
<p>im tring to pass a string to another view but with no success.</p>

<p>I have a picker with a button:</p>

<p>picker.m</p>

<pre><code>    @synthesize marray2, marray1;

    -(IBAction)show:(id)sender

    {

NSInteger breadRow = [mpicker selectedRowInComponent:kBreadComponent];

NSInteger fillingRow = [mpicker selectedRowInComponent:kFillingComponent];

NSString *bread = [self.marray2 objectAtIndex:breadRow];

NSString *filling = [self.marray1 objectAtIndex:fillingRow];

NSString *message = [[NSString alloc] initWithFormat:@"Your %@ and %@ will be right up.", filling, bread];

UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@" Thank you " message:message delegate:nil cancelButtonTitle:@" OK " otherButtonTitles:nil];

[alert show];

[alert release];

[message release];

    }
</code></pre>

<p>i want to pass 'message' to another view which uses table cell drawing:</p>

<p>(excerpt from FoodOutput.m):</p>

<pre><code>    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *MyIdentifier = @"MyIdentifier";
MyIdentifier = @"tblCellView";

TableCellView *cell = (TableCellView *)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if(cell == nil) {
    [[NSBundle mainBundle] loadNibNamed:@"TableCellView" owner:self options:nil];
    cell = tblCell;
}



/*if(message== nil){ food = [[NSMutableArray alloc] initWithObjects:@"choose your food", nil];} else {food = [[NSMutableArray alloc] initWithObjects:[self message],nil];}*/


      arrayNum = [[NSArray alloc] initWithObjects:[NSString stringWithFormat:@"%d", indexPath.row+1],nil];

    //This is where i want to use message from the other view:

[cell setLabelText:message];

    //But that doesn't work???????

[cell setLabelRowNum :[arrayNum objectAtIndex:0]];
return cell;
</code></pre>

<p>}</p>

<p>now what makes my task difficult is that I've got a tab bar controller which is the subview in the app delegate, and I've wrapped up the table view in a nav controller, which when clicking on a cell, brings up the picker view, which in turn once the button is pressed, is supposed to revert back to the table view with the cell populated with the food choice.</p>

<p>Can anybody help without having to revert to singletons or involving the app delegate?</p>

<p>Thanks and i await your clever workaround with glee :)</p>

<p>Trev</p>
