passing array from one viewcontroller to another
i have a custom tabBar class in which i switch three view controller开发者_如何学JAVAs ,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 likeInbox *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 itDo 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.
Check your property in Inbox class and check to see if self.array is not null.
Edit try: inbox.array = [NSArray arrayWithArray:self.array]
ok this worked when i passed the value to applicationdelegate and from the other class accessed from here.
精彩评论