In my app i making use of uitable to select category from my list. my task is,when ever user click or select a cell he should be able to view the selected cell detail in next vi
You need to make use of custom delegates. Create a protocol in your detailview and implement it in your rootview.Pass the selected string as parameter to delegate method and from the delegate method, display it in your textfield.
//something like this
@interface detailViewController
// protocol declaration
@protocol myDelegate
@optional
-(void)selectedValueIs:(NSString *)value;
// set it as the property
@property (nonatomic, assign) id<myDelegate> selectedValueDelegate;
// in your implementation class synthesize it and call the delegate method
@implementation detailViewController
@synthesize selectedValueDelegate
// in your didselectRowAtIndex method call this delegate method
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self selectedValueDelegate])selectedValueIs:valueString] ;
[self.navigationController popViewControllerAnimated:YES];
}
@end
// In your rootViewController conform to this protocol and then set the delegate
detailViewCtrlObj.selectedValueDelegate=self;
//Implement the delegate Method
-(void)selectedValueIs:(NSString *)value{
{
// do whatever you want with the value string
}
Hi you will have to do it using protocols and delegate Please see my linkon protocol and delegate
you can also do it by creating a variable in appdelegate , setting its property and accessing it in any other view .
YourAppDelegate *appDelegate = (YourAppDelegate *)[[UIApplication sharedApplication] delegate];
delegate.yourVariable;