I’m a newbie and a little frustrated. I am trying to pass data between the UITabBarController and failing hardly at it.
If anyone can help me, I will be grateful. I have a UITabBarController added to the AppDelegate views but I have no idea on how to pass data around. For example, my intuition tells me that I have to define a variable in “the root” which has connection to the tab bar controller so I guess that is the main app delegate. But, tbh, I don’t even know where to define this variable in the app delegate. Is it inside the @interface? anywhere after it? before @end? And I tried initializing a NSString variable there and put the main app delegate.h in the other view controller but they cannot recognize the variable.
I should explain that it is slightly complicated because I am incorporating a 3rd party SDK (red laser) into my app and they have a wrapper view controller (overlay) which calls their SDK and they provide a function which returns the barcode after scanning. I am able to “collect” this barcode but I don’t know how to pass it to other views/view controllers.
@the author: Kindly reminder! You mentioned in the book (page 180) that many programmers new to iphone programming struggle with passing data and yet you only have 1 example (up to that point unless I missed any, please tell!) in which a UITableViewController passes data to another controller (ItemDetail…). If it is something many programmers struggle with, it will be nice to add a little bit more example and clarification on how to do just that. In fact, I don’t really understand that particular code sample.