0

I want to instance the RootViewController with different objects depending on the target I'm the running.

For example,

I have 3 RootViewControllers (RVCBase, RVCA, RCB) and 4 targets (T1, T2, T3, T4). I want that whenever T1 is running, RVCA shows as the RootViewController; when T2 runs, RVCB; and when either T3 or T4 is running, the RCVBase shows.

Any help?

Thanks in advance.

mikywan
  • 1,495
  • 1
  • 19
  • 38

2 Answers2

1

Add define for exemple (T1, T2, T3, T4) with preprocessor macros. see build settings tab You can handle in code with:

#ifdef T1
//do something
#elif T2
//do something
#elif T3  
...
#endif
0

Use [self.window setRootViewController:rvca]; to set the RootViewController for the window.

You will have to set for the target and then pass in the RVC you want.

mahboudz
  • 39,196
  • 16
  • 97
  • 124