trying to remove audio file from project - ios

I can't seem to get rid of an audio file in my iOS project. I had it in my Supporting Files folder but deleted it (moved it to the Trash, not just its reference).
It is still being picked up by this line of code in my DetailViewController:
NSArray* soundFilesArray = [[NSBundle mainBundle] pathsForResourcesOfType:#"wav" inDirectory:nil];
I'm sure it's something simple, but I'm still rather new to this so am confused as to how XCode is finding the file. After looking everywhere in the XCode project, I even scoured all folders (in a Terminal) and couldn't find anything. I also did a Clean (Product > Clean).

File is cached in your .app file. For clean this, do this steps:
1) Open Organizer
2) Click Projects
3) Find your project at left panel and click
4) CLick on Delete at center panel
5) (Optionally) If you want a see in Finder, click on Arrow who after a "Derived Data" path
6) Build your project. And XCode will copy your resources at again.

Even though you've removed the file from your project, it has already been copied to the device you were building to (either the Simulator, or the iPhone or iPad you were testing on). Delete the app from the device, and all files will be removed from it. Then, since you have already cleaned the XCode project to ensure the file is really gone, if you rebuild to your test device, the file should be gone for good.

Related

With Xcode how can I export and share an app with a team member in the simulator?

So I have a teammate/client I need to share an app I'm developing.
They have android and a Mac Desktop so it would be shared through the Simulator only.
I've tried the archive app and there seems to be no way to get this work with the .ipa file which is generated.
Does anyone know of a way to achieve this?
Share the source code, then run the app in Xcode. Voila, it is now in the Simulator. They have to install Xcode anyway to get the Simulator so there really isn't any extra work involved other than building the app.
The .ipa is built for iOS devices and cannot run in the Simulator. I suppose you could transfer the binary to another simulator and get it to work, but I have not heard of anyone doing it that way and, frankly, it seems like potentially more work than "clone this git repo, load the project/workspace in Xcode, click the triangle button and wait a bit."
All you can do is you can just generate the .app file. But how you can run it on a simulator (applies only if Xcode 8.2 or above isn't installed), I really don't have the idea. If you want to have your .app generated, follow this:
Connect any iPhone with your mac
Open your project in Xcode
Wait for the setup (processing symbol files, blah, blah) to be completed
Run your project in that iPhone once
Now just build your project while the iPhone is connected
Search for the Product group (or, folder) and expand it
You will see a file (maybe more) named as your target (project name)
Right click on that file and select show in finder. And voila, you have your .app file
What generates the .app
You will need to have previously built the app for the intended target. The "Product" option in the top menu bar includes a couple of ways to trigger this including: "Build for" of "Destination".
Where is the .app?
The yourApp.app you are looking for is stored in: <<YOURUSERHOME>>/Library/Developer/Xcode/DerivedData/<<YOURAPPNAME-UID>>/Build/Products/Debug-iphonesimulator
Easier way to locate
Open you app in XCODE
Browse the file tree in the left sidebar
Expand the "Products" directory
Right click the .app file you want to share, and select "Show In Finder"
What you are trying to do is not going to work. You can not share the .ipa file for someone else to install it on an iPhone simulator.

XCode won't run my application on a device/simulator anymore

I am kind of stuck with my XCode problem. First of all: I have a project that contains 5 different targets. Now something went wrong (I can't remember changing anything related to project settings).
If I want to run any target on device or simulator the build succeeds but then nothing happens. Neither the app is started in simulator nor on a device. So I checked the Scheme (-> "Edit scheme") and I could not select my app in the Executable menu. I think I can remember that the .app file was selected there before (as it is if i create any new project). Does anyone know why I can't select anything there?
What I am curious about, is the fact that choosing "Other" in the Executable menu brings me to my DerivedData directory that indeed contains the *.app file resulting from the build. That leads me to my next problem.
If I select this *.app file explicitly and try to run the app XCode gives me the error " does not have an architecture that can execute." But I checked my settings many times and I am definitly using $(ARCHS_STANDARD) in every target.
I am a little bit lost here ... does anyone has a hint, what could have messed up my project and how to fix it?
Might not work, but I've found a lot of bugs in xcode which simply require quitting it, and reopening.
You could also try clearing out the DerivedData directory. Do a full clean build (hold down option key when selecting clean build).
And lastly, reset the simulator via the menu iOS Simulator > Reset Content and Settings.
I got this when I changed the name of my App on one development machine and then tried to work on it a few months later on another machine. I fixed it by deleting the old scheme and Autocreating the new scheme. The settings are under Product - Scheme - Manage Schemes.
OK I solved the problem by myself. I was on the right track before. I did compare the project.pbxproj file again using FileMerge. I merged all lines related to an *.app file from the working version into my corrupt project file. After that my project was fixed. The *.app files showed up under the "Product" group in XCode and I could run the application on simulator/devices again. It seems that I forgot something while I was merging the files via copy & paste. ;)
Rather than cleaning out the DerivedData directory from Xcode, have you tried the "old fashioned" way from Finder? Try quitting Xcode, nuking ~/Library/Developer/Xcode/DerivedData/ModuleCache from Finder, and restarting Xcode.

Deleted .xib Still Appears Xcode 5 OSX Development

While working on an OSX app, I created a .xib file that I have since deleted. I clicked the "move to trash" option, not just "remove reference". I also took the following steps:
Delete the project created by running the app
Clean the project (cmd-shift-k)
Clean the project's build folder (cmd-shift-opt-k)
Delete the derived data folder at ~/Library/Developer/Xcode/DerivedData
Delete everything within /var/folder
Restart Xcode
Yet when restarting Xcode and running the app, the window from the deleted .xib still appears. Any ideas how to get rid of this damn thing? I'm using OSX 10.9.2 and Xcode 5.1.
The window persisted in the side panel of MainMenu.xib. As can be seen, I have a window called "Bean Api Example". The window that wouldn't go away was also listed there. Once I deleted that listing, the window no longer appeared when running the app.
I'm not sure how that window appeared on the side panel in the first place, as creating a new xib with a window did not list a window in MainMenu.xib.

Compilation fails in Xcode 4.6 while creating archive for adhoc distribution.

I am new to iOS. and i am trying adhoc distribution ipa file from xcode.
1) I could able compile and run the application in the iphone/ipad.
2) But when i create archive, i am getting compilation error saying 'something.h' not found.
Could someone kindly direct me what could be wrong?
1-Try to open the organizer (Window -> Organizer), then the Projects tab. Select your project then hit the delete button next to the derived data path (to the right). Confirm and let it re-index your project.
2-Go to your project folder, Press on YOURPROJECTNAME.xcodeproj and right click and go to show package contents . Leave the project.pbxproj file, but delete the project.xcworkspace file, any .pbxuser files, and the entire userdata folder.
I hope it works..
If you are putting things in a group in the XCode project navigator, and it is not an actual folder, you do not need to do Mountain/Mountain.h. You would just include Mountain.h.
When creating a group in the project navigator, by default, these are not actual folders, they are just virtual project folders, so if it is trying to see the Mountain folder and it does not exist, you will get that error.
It is weird that it will compile and run otherwise, but just give that a shot, let me know if it works.

iPhone project has "My Mac 64-bit"

I'm working on an iPhone project and somehow the schema has "My Mac 64-bit" and "My Mac 32-bit" in addition to the normal "Simulator 4.3" and "IOS Device".
Is there anyway to remove the "My Mac..." options? It always wants to switch to these when I switch git branches and I end up building without realizing it and get an error. More of an annoyance than anything.
Could possibly be something with your xcuserdata folder.
Right-click on the xcodeproj file and select "show package contents."
Make a backup copy of the xcuserdata folder.
Now delete everything inside the xcuserdata folder, and restart xcode.
If causes a problem, then put backup folder back in.
This happens to me every time files get modified outside of Xcode, and Xcode needs to reload the project file. Closing the project and re-opening it always fixes the issue for me.
If you are porting your Xcode project from one mac to other then this issue happens most often. You can Try These two resolutions: First one only worked for me:
Resolution:1
Open Your project folder > Right Click on Xcode and Select “Show Package Content” Inside there we will get one folder “XcuserData”.> Open the Xcuserdata folder and delete all its content. >Now Launch the Xcode project again, the problem should be fixed now.
if the above resolution is not working then try this one:
Resolution:2
open Xcode > clicked on Manage Schemes and then Autocreate Schemes Now > Then select the new scheme in Xcode.
Hope either resolution should work for you.
This is a bug in the beta builds for Xcode 4.2, with regards to their handling of Git repos (confirmed at WWDC with Xcode devs). According to a friend of mine it's been fixed in Xcode 4.2 beta 5, but there are a bunch of issues with that build and you might want to hold off until beta 6.
Step 1: Right Click on Xcode project > Show Package contents > xcuserdata > Delete All content
Step 2: Open project > select target > (Project name)Tests > Host Application > select application > allow testing application APIs
Resolved :) Enjoy your Code
I always open my projects from within Finder to get around this problem. Browse to your project directory, eg /apps/iOS/iPhone/SingleViewApp. Double clicking the .xcodeproj file launches the project within Xcode. I see "Checking DDI Symbols" msg and soon after iPhone device name appears.

Resources