I am trying to set up an object to manage all my data so that it can set preferences in the background so that it looks like my tables are browsing faster than now, etc.
This is what I am trying to achieve.

I set the variable to NSObject from secondVC when the tableviewcell is selected as follows:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //Access selected cells content (cell.textLabel.text) UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; //Parent view logic (sends info back to the correct cell in parent view) if (parentViewSelectedIndexPath.section == 0) { if (parentViewSelectedIndexPath.row == 0) { //Predicates restrict the values that will be returned from the query NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K like %@",@"MANUFACTURER",cell.textLabel.text]; NSArray *filterArray = [myDataArray filteredArrayUsingPredicate:predicate]; //[[self delegate] setManufactureSearchFields:filterArray withIndexPath:indexPath]; //This is where I pass the value back to the mainview //Using Object VehicleControllerNSObject *vehicleControllerNSObject = [[VehicleControllerNSObject alloc] init]; [vehicleControllerNSObject setFirstCell:filterArray]; } //etc
At the end, you will see the method that is installed in the VechicleControllerNSObject, which looks like this.
-(void)setFirstCell:(NSArray *)array{ manufactureSearchObjectStringFVC = [[array valueForKey:@"MANUFACTURER"] objectAtIndex:0]; NSLog(@"%@", manufactureSearchObjectStringFVC);
As you can see, this correctly outputs the result.
however, I have no idea how to call productionSearchObjectStringFVC and pass the value that it stores in uitableviewcell, which I would like to pass in my first controller.
This is what I have for testing atm.
- (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; VehicleControllerNSObject *vehicleControllerNSObject = [[VehicleControllerNSObject alloc] init]; manufactureSearchObjectString = vehicleControllerNSObject.manufactureSearchObjectStringFVC; NSLog(@"%@", vehicleControllerNSObject.manufactureSearchObjectStringFVC); }
This nslog prints zero ..
I have three questions
1, how do I get the correct value in the first value controller.
2, should I use viewDidAppear like this? .. I think not .. how can I do it better
3, What do you think is a good way to do this type of thing, since in the future I would like to use NSObjectClass to analyze information, cache, etc. it's all about the feelings, leaving the views simply displayed when the data is ready, hopefully helps in productivity.
Any help would be greatly appreciated, as I really want to study this material, as I know its important knowledge for me.