title: RCTSharedApplication() delegate error react native
body: <p>So I'm fairly new to react native and mobile development in general, this error keeps cropping up, the test file in question that is failing is the standard generated file provided by Facebook with a react native build.</p>
  
  <p>Here's the test:</p>
  
  <pre><code>- (void)testRendersWelcomeScreen
     {
    UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
    NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
    BOOL foundElement = NO;
  
    __block NSString *redboxError = nil;
    RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
      if (level &gt;= RCTLogLevelError) {
        redboxError = message;
      }
    });
  
    while ([date timeIntervalSinceNow] &gt; 0 &amp;&amp; !foundElement &amp;&amp; !redboxError) {
      [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
      [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
  
      foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
        if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
          return YES;
        }
        return NO;
      }];
    }
  
    RCTSetLogFunction(RCTDefaultLogFunction);
  
    XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
    XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
  }
  </code></pre>
  
  <p>And here is the error:</p>
  
  <pre><code>redacted/ios/ProjectTests/Project.m:40:29: error: bad receiver type 'int'
    UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
  </code></pre>
  
  <p>The app seems to actually compile and work in iOS simulator so I'm not really sure what the problem is, the obvious answer could be just remove the test. However I'm interested in a possible cause, cheers.</p>