0

I manage to pass the following array from MessagesTableViewController.m to arraySelectedCategory in another class called MessageDetailViewController.m:

self.messageDetailViewController.arraySelectedCategory =
        [[NSMutableArray alloc] initWithObjects:@"Value 1",@"Value 2", @"Value 3", nil];

but how do I hand over an array stored in: NSMutableArray *categories;

self.messageDetailViewController.arraySelectedCategory = ?????

Thanks!

2 Answers 2

2

I take it that you want a copy of the categories array?

self.messageDetailViewController.arraySelectedCategory = [categories copy];
Sign up to request clarification or add additional context in comments.

2 Comments

@Darko Yes. And if that's not what your're looking for, a simple self.messageDetailViewController.arraySelectedCategory = categories should do.
Thanks! It helped a lot. I am still new to Objective C.
0

You can use NSUserDefaults. The value can be used in whole program.

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.