2

How can I send data from one view controller to another via segue ?

country = [[NSMutableArray alloc]initWithObjects:@"Afghanistan", @"Albania", 
@"Algeria", @"American Samoa", @"Andorra", @"Angola", @"Anguilla", @"Antarctica", 
@"Antigua and Barbuda", @"Argentina", @"Armenia", @"Aruba", @"Australia",
@"Austria", @"Azerbaijan", @"Bahamas", @"Bahrain", @"Bangladesh", @"Barbados",
@"Belarus", @"Belgium", @"Belize", @"Benin", @"Bermuda", @"Bhutan", @"Bolivia", 
@"Bosnia and Herzegovina", @"Botswana", @"Brazil", nil];


- (IBAction)onContactClick:(id)sender {

//[self performSegueWithIdentifier:@"TableViewController" sender:self];

1 Answer 1

1

Use SMQuickSegue https://github.com/stefanomondino/SMQuickSegue it's really easy, follow the instruction and the example to include it via cocoapods (or just drag .h and .m file after downloading it), import the file in your view controller (extend SMQuickViewController if you can) and then

- (IBAction)onContactClick:(id)sender {
 [self performSegueWithIdentifier:@"TableViewController" parameters:@{@"country_array":country];
 }

where country is your array and country_array is a property in your "next" view controller.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.