I have an iPhone app with a tableviewcontroller. When you click a certain cell it opens a new uiviewcontroller with this code:
nextViewController = [[avTouchViewController alloc] initWithNibName:@"avTouchViewController" bundle:nil];
The uiviewcontroller above called avTouchViewController has a property that looks like:
IBOutlet SomeObject *controller;
SomeObject is an object with all relevant view properties.
I would like to pass an nsstring parameter from the tableviewcontroller I initialize the avTouchViewController with to someObject.
How can I do this?
I’m a little confused by your question; you say you’re creating your
avTouchViewControllers when a cell is tapped inside an existingUITableView, but your last part describes the inverse situation.Basically, if you want to pass information to a view controller, just give it a property that can be set (which may already be the case), e.g.:
You also may want to rename your
controllerproperty. To a reader, it doesn’t make sense that a view controller has a property calledcontrollerwhich is actually aSomeObject*. As well, your class names should be capitalized, i.e. useAvTouchViewControllerinstead ofavTouchViewController.