fozoglu
fozoglu

Reputation: 829

How to pass data from one ViewController to MainViewController without using segue?

I want to send data from ParcelResultViewController to ViewController(Main) but I don't have connection segue between ParcelResultViewController and viewcontroller. I shared my storyboard image and code block.

How can handle this situation ?

ParcelResultViewController.m

if (nil == self.viewcontroller) {
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
        self.viewcontroller = [storyboard instantiateViewControllerWithIdentifier:@"ViewController"];
        self.viewcontroller.fieldAliases = self.gonderilenFeatureSet.fieldAliases;
        self.viewcontroller.displayFieldName = self.gonderilenFeatureSet.displayFieldName;

        NSLog(@"%@",[self.gonderilenFeatureSet.features objectAtIndex:indexPath.row]);

    }

    //the details view controller needs to know about the selected feature to get its value
    self.viewcontroller.feature = [self.gonderilenFeatureSet.features objectAtIndex:indexPath.row];

enter image description here

Upvotes: 2

Views: 131

Answers (1)

David Ansermot
David Ansermot

Reputation: 6112

Send a notification from the parse controller with the data as object.

Use the NSNotificationCenter to do that.

Upvotes: 2

Related Questions