Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Yes you can. When you create a new target it creates a new directory in your project folder which makes it easy to have the same file names for multiple files. When you add a new or old interface file, in fact any file, Xcode asks you which target you want to add. Just check the target where you want to add. You can manually manage files in Target/Build Phases/Bundle Resources</p> <p>I have made a number of free version already this is what I usually do:</p> <ol> <li><p>Create a new Target for the free version</p></li> <li><p>Remove all its added files except appname-info.plist file.</p></li> <li><p>Add all common source files to the target Target/Build Phases/Compile Resources (can drag and drop from navigator)</p></li> <li><p>Add all common other files (icons etc.) to the target Target/Build Phases/Bundle Resources (can drag and drop from navigator)</p></li> <li><p>Add all required frameworks (can drag and drop from navigator)</p></li> <li><p>Left click/Show in Finder on the interface files I want to change. Copy files to the newly created directory in the project</p></li> <li><p>Drag the copied interface files from Finder to Xcode and drop it in the newly created target group. Uncheck "Copy items into the destination group" as it is already there. Make sure that the desired target is checked under "Add to targets" </p></li> </ol> <p>It also works for everything else icons, images, videos, etc. If you avoid hardcoding names, it works like a charm. I have projects with up to 6 targets (3 full version, 3 free) which share the same code, but different xib, icon and multimedia files. I usually remove limitations based on whether the app is free/lite or not with the following code (Mac, for iOS just remove the badge setting lines) :</p> <pre><code>NSString *appName = [NSString stringWithString:[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"]]; if ([appName rangeOfString:@"Lite"].location != NSNotFound || [appName rangeOfString:@"lite"].location != NSNotFound) { //put lite badge on NSString *badgeText = @"lite"; [[NSApp dockTile] setBadgeLabel:badgeText]; fullVersion = NO; } else if ([appName rangeOfString:@"Free"].location != NSNotFound || [appName rangeOfString:@"free"].location != NSNotFound) { //put free badge on NSString *badgeText = @"free"; [[NSApp dockTile] setBadgeLabel:badgeText]; fullVersion = NO; } else { fullVersion = YES; } </code></pre>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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