0

I able to run my old iOS code (working properly in iOS 12 XCode 10.1) in XCode 13.2.1 and iOS 15.2. In my code a module which was developed in React Native. React Native module i added as a subview on UiView code as below,

if(reactView){
    [reactView removeFromSuperview];
    reactView = nil;
}

NSURL *jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"prodmain" withExtension:@"jsbundle"];

NSDictionary *props = @{@"DashboardType" : @"PIAdmin"};
reactView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"PIAdminApp" initialProperties:props launchOptions:nil];
reactView.frame = CGRectMake(piDashboardView.frame.origin.x, 0, piDashboardView.frame.size.width, piDashboardView.frame.size.height);
reactView.backgroundColor = [UIColor whiteColor];
[piDashboardView addSubview:reactView];

Above code worked properly in XCode 10.1 till version iOS 12 but when i run it on iOS 15 and XCode 13.2.1, i got exception from here below screenshot,

enter image description here

I was stuck in compliling old code but I change some build setting in XCode so its working, link as below, Want to remove duplicate symbol error during compile time xcode ios

I doubting about above change property. If undo changes then i faced same compile time error. So right now i'm confused completely.

Shri Samarth
  • 101
  • 1
  • 12

1 Answers1

0

I got an answer from github react-native community, reference link here

My updated code as below,

static BOOL RCTParseUnused(const char **input)
{
    return  RCTReadString(input, "__attribute__((unused))") ||
            RCTReadString(input, "__attribute__((__unused__))") ||
            RCTReadString(input, "__unused") ||
            RCTReadString(input, "__attribute__((unused))");
           
}

I keep old code with suggested code in OR condition.

Shri Samarth
  • 101
  • 1
  • 12