Note that there are some explanatory texts on larger screens.

plurals
  1. POpassing data between tabs in iOS
    primarykey
    data
    text
    <p>it is my first app that I am trying to do on my own and I have some questions. I want to have 4 tabs, and in the first one named "HomeView" I am parsing JSON data (this is done so far).</p> <p>But what I want is some of the data that are being parsed to be visible in other tabs (and not have to parse them again).</p> <p>So parts of my code of HomeView is here:</p> <pre><code>#import "HomeView.h" @interface HomeView () @end @implementation HomeView //other code - (void)connectionDidFinishLoading:(NSURLConnection *)connection { //data fetched parsed_date=[res objectForKey:@"date"]; NSLog(@"Date:%@",parsed_date); [UIAppDelegate.myArray addObject:parsed_date]; } </code></pre> <p>and I can see the "parsed_date" being printed out correctly.</p> <p>So I want this parsed_date to be visible in OtherView.</p> <p>This is my code but I cannot print it out.</p> <p>OtherView.m</p> <pre><code>#import "OtherView.h" #import "HomeView.h" #import "AppDelegate.h" @interface OtherView () @end @implementation OtherView @synthesize tracks_date; - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. //preview value of other class tracks_date = [UIAppDelegate.myArray objectAtIndex:0]; NSLog(@"Dated previed in OtherView: %@", tracks_date); } </code></pre> <p>and (null) is being printed out.</p> <p>added code of app delegate.h</p> <pre><code>#import &lt;UIKit/UIKit.h&gt; #define UIAppDelegate ((AppDelegate *)[UIApplication sharedApplication].delegate) @interface AppDelegate : UIResponder &lt;UIApplicationDelegate&gt; @property (strong, nonatomic) UIWindow *window; @property (nonatomic, strong) NSArray *myArray; @end </code></pre> <p>So can you suggest me a sollution?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload