Is there a way to exclude some files from submitting to the iOS app store - objective-c

I am working on an app that i would like to submit to the store and i have some files that is part of the project that i don't want to be part of the archive.
For example some viewcontroller files that i made but are not going to use for this version of the app or some data files that i am reading into the database that not needed in the release.
Do i have to delete everything before creating the archive or i can some how choose for them not to be included. Also some of the viewcontrollers on the storyboard are extras would i have to delete them also?
Thanks in advance!

Only files that are part of the target you're archiving will be included in the archive and submitted to the App Store. You can add or remove files from a target by selecting it and editing the checkbox in the file inspector panel on the right:
To see all the files that are included in your target, select your project in the file browser on the left. Then select your target and the Build Phases tab.
Under Copy Bundle Resourses you'll see all the resource files that will be added to your app's bundle (and the archive).

You can selectively exclude files from your Xcode project:
In your project settings, select your target. In your target, select Build Phases pane. From there, you can exclude compilation sources and bundle sources via the "Compile Sources" and "Copy Bundle Resources" lists.

Related

Include Library into XCode Project

I want to include the FMDB library into an existing XCode Project. I know how to install it with pods. But is there a way to link it somehow with Build Phases - Compile Sources or Build Phases - Link Binary with Libraries? I am not sure how to do that, what files from FMDB to link, where to get the files, where to Drag & Drop what...
Simply download this project first: https://github.com/ccgus/fmdb
After extracting zip you see a folder under fmdb/src.Under src have another directory named fmdb. You need to drag this folder and drop into your project. Then you can easily access FMDB code.

how to create our own private library with xcode

I have written customise controllers in swift in xcode, and with git i have uploaded them on gitlab, now when i'm trying to clone this library with other projects, i had to add all files in xcode to use those files, it's pretty annoying though to add files if we want to use them, is there any other way to overcome this
Basically you want to maintain library files and add them all at once to your Xcode, follow these steps
go to project file -> Build Phases -> Copy Bundle Resources
and then click on + icon
select "Add Other..."
Select your folder
Now it will always build your library files along with your project files.
Hope this Helps!!

Auto copy .app to Applications folder

When I click Product -> Archive for a Mac app in Xcode 6, I want the .app file to be automatically copied to the Applications folder replacing the earlier copy.
I've noticed there are post build actions for the Archive scheme but I don't know how to achieve this.
Basically you will want to add a custom shell script phase.
You could do any number of things there.

What should I do if I can't find the GPUImage.h header for the GPUImage framework?

I have created a sample application to perform bump distortion, using the GPUImage framework. I added this framework to my application, but I'm seeing the following error
Lexical or preprocessor issue 'GPUImage.h' file not found.
I have added the -ObjC flag to the Other Linker Flags, but I'm still seeing this error. How can I solve this problem and get my application to compile?
Adding GPUImage framework to XCode project could be tricky. So I haved added detailed step-by-step instructions w/ images on how to do it.
Static Compilation Method (detailed solution so we don't mess up)
This is Static compilation method. In this basically we will compile the framework using ./build.sh file. And simply add it to our XCode project, then configure XCode to properly use it.
Download GPUImage from Github and extract it (or just clone it).
Go to the GPUImagefolder in terminal
Run ./build.sh
Note: This will compile and create ready-to-use binary for all the sdks on your mac.
build.sh creates a folder called build and generates compiled binaries and dumps them to folders like: Release-iPhone, Release-iPhoneOS, Release-iphonesimulator etc folders.
For iPhone use Release-iphone (This also works for simulator).
Copy (not drag-drop) Release-iphone to your XCode project's root directory so that we have a local copy of framework.
Now iPhone drag-and-drop Release-iphone onto your XCode project. Make sure to check "Copy to .." option.
Note:
This Release-iphone folder contains two sub-folders: include and lib
include folder contains all the header .h files
lib folder contains compiled binary version file called libGPUImage.a
We now need to simply configure XCode to use .h and .a files.**
Select your project in the project explorer > Project name under Targets > select Build Phases > Expand Link Binary With Libraries
Add the libGPUImage.a to Link Binary With Libraries section. You may want to Right-click on libGPUImage.a then Open in Finder and finally drag-drop it.
While we are at it, also add the following GPUImage's dependent frameworks/ libraries
CoreMedia, CoreVideo, OpenGLES, AVFoundation, QuartzCore to Link Binary With Libraries section
Now, lets configure .h headers.
Select your project in the project explorer > Project name under Targets > select Build Settings > and type search paths to see search paths section.
Open Headers Search Paths by clicking on the value field.
Drag-and-drop the lib folder to that popup. Note: If it shows absolute path, change it to looks $(SRCROOT)/path/to/lib/. (You should have the framework relative to your xcode project see step 6).
Repeat 11 & 12 for Library Search Paths as well.
Additional tips: You can add .h files to Library Search Paths or Headers Search Paths, you can make them Recursive. I have a main root-folder called Dependencies folder where I keep all the dependencies like MySDK-framework including Release-iPhone. And I just have one search-path at the Dependencies (root folder) and made it recursive.
Did you follow all of the instructions from the Readme on the project page? From the installation instructions:
You'll also need to find the framework headers, so within your
project's build settings set the Header Search Paths to the relative
path from your application to the framework/ subdirectory within the
GPUImage source directory. Make this header search path recursive.
If you're seeing the above error, it means that you did not point the Header Search Paths at the right directory where you've installed GPUImage relative to your project, and / or did not click the checkbox to the left to make those search paths recursive.
I show some screenshots of where you need to go to set this in this answer, which explains something similar for the Core Plot framework. The same principles apply, only you need to find where you installed the GPUImage framework at.
I add relative path to "Header Search Paths", but there is still a error that is "not found".
Then, I add path to "User Header Search Paths", and it works.
May help you.
finally, I realized the KEY WORD is relativeļ¼
I put GPUImage source files in my project root dir:
before I solved the problem, I add Header Search Paths is:
$(PROJECT_DIR)/GPUImage/framework
$(PROJECT_DIR)/GPUImage/framework/iOS
and make them Recursive, but error is still there, So I changed Paths to:
GPUImage/framework and make it Recursive, then it works.
Hope it helps.

libcocos2d libraries.a & PROJNAME.app missing

I have this new project created via the cocos2d 1.0.1 template in Xcode and I was copying over files from the project whose cocos2d engine is outdated (it's dated to 99.4, but it didn't have a CCSpriteBatchNode, instead using CCSpriteSheet) and I was rearrange files around into folders that matched the setup of the old file.
One of the folders is Products, which I stuck in the 'Code' folder. However, the two files within this Products folder have gone red:
MyGame.app
libcocos2d libraries.a
meaning they're undefined, and I need help solving this conundrum, I'm very new to paths and directories. Here's a screenshot:
http://i207.photobucket.com/albums/bb289/teh_Mac/Screenshot2011-12-21at90907PM.png
After you created the new project, you should only add source code files and resource files to your project. There's no need to recreate the Products folder.
Besides, the .app and .a are files that are created during the build process. Until you've made a successful build, they will remain in red. And even if the build was successful they may remain red due to bugs in Xcode.