0

i have a custom tabBar class in which i switch three view controllers ,i am removing the presentview controller and presenting the other .
custom tabbar class
-list
-inbox
-messages
now i have to pass an array from list to inbox i usually create an instance of the recieving class like

Inbox *inbox=[[Inbox alloc]init];
inbox.array=self.array;  
but in this case its not working.the array in inbox class returns null when i nslog it

1

3 Answers 3

0

Do you inherit or use the UITabBarController in your custom tabBar?

If you want to pass a variable between list<->inbox<->messages I would suggest that you implement a method in the tabBar that can be called from the subviews. The method would send the array to the appropriate subview.

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

1 Comment

its a uiviewcontroller that follows tabbardelegate protocol .its similar to wiredbob.com/blog/2009/4/20/….
0

Check your property in Inbox class and check to see if self.array is not null.

Edit try: inbox.array = [NSArray arrayWithArray:self.array]

2 Comments

self.array is not null..i have nslogged it ,and i have set the @property(nonatomic,retain)nsarray array in inbox class.is it any problem in changing the views....usually this worked when i used pushviewcontroller
but the problem here seems to be inbox.array, that one is the one which doesn't look like it has been initialized.
0

ok this worked when i passed the value to applicationdelegate and from the other class accessed from here.

1 Comment

can you provide the steps you followed to pass array from one view controller to another view ontroller.Thank you

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.