Deleted .xib Still Appears Xcode 5 OSX Development - ios

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.

Related

Spark Inspector

I am interested in Spark Inspector, but i cant use it in trial mode.
I installed latest version. Then i used framework setup assistant, but it not helps.
Building settings are correct - i checked it step by step with this instructions: http://www.sparkinspector.com/framework_setup.html
I also tried to clean project and delete app from iOS simulator.
The app is for iPad, i don't know is it matter.
The error i getting is: "Setup did not complete successfully. The Spark Inspector timed out waiting for the console to settle."
I love this tool - It actually includes a wizard that lets you choose a xcode project and sets it up for inspection. try using the built in wizard.
EDIT: With version 1.3.3 of Spark Inspector, it seems it sometimes takes a while for SI to connect to the process. After you get the error, try clicking the OK button and wait for about 30 seconds. It should eventually connect. Otherwise, try some of the other tips below.
Deleting the Xcode Derived Data sometimes fixes this for me:
launch Xcode
from menubar: Xcode > preferences
click the 'Locations' tab
beneath "Derived Data" you'll see a path with a small arrow icon, click on the arrow
from the Finder window that appears, drag the 'DerivedData' folder (should be automatically selected) into the trash
quit Xcode
restart Xcode and try launching Spark Inspector again
Another thing to check is to make sure your command line tools are setup to run the same version as your current version of Xcode (happens sometimes if you have multiple copies installed at the same time like a beta):
launch Xcode
from menubar: Xcode > preferences
click the 'Locations' tab
Check the current value for 'Command Line Tools'. If it's not the same version as the Xcode version you're trying to run Spark from, then:
Select correct version
Delete the Derived Data
Quit Xcode
Restart Xcode
Clean your project (cmd-K)
Try re-running with Spark
I had the same problem. Make sure you have the dylib in the following path:
Applications/Spark Inspector.app/Contents/Resources/Frameworks/SparkInspector.dylib
I re-installed the application, force xcode to quit, re-opened xcode and the project. I've clean the project as you did and then use Product-Inspect with spark.
It takes few secondes to start after the simulator is launch. It also breaks on a line on the debugger until the inspector app is launched.
Hope this will help

Storyboard won't update in simulator

I have a working app in Xcode, however when I try to build and run it the simulator displays an older version of the storyboard I was working on. I had changed some of the design on the storyboard but this does not reflect in the simulator, nothing is updated.
Does anyone have any ideas?
Delete the App on the simulator.
Clean
List item
Build & Run
Use NSLog(#"") in your controller to check code execution.
I just spent at least 6 hours on this. I have a solution, but I also submitted a technical support ticket to apple to try to get more info on the cause and proper solution.
Simply remove the references to your storyboard files and add them back in the same file group.
This seems to include the storyboard files back into the app bundle generated during build(which can be seen in the
DerivedData/APPNAME/Build/Products/Debug-iphonesimultator/APPNAME.app
From here I can see my changes reflected from the storyboards as expected.
PS - Are you using localization at all? I was.
I lost 2 hours to this.
Solution was braindead simple: delete app, turn OFF the iPhone 5S (iOS 7.1.1), and turn it bavk on.
When you turn on localization,
xcode moves storyboard file in localization folder (ex. Base.lproj/name.storyboard). When you build and run project on simulator, xcode copy name.storyboard into "derivedData"/Base.lproj/name.storyboard, but previous, created before localization "derivedData"/name.storyboard still exists. In this case simulator uses the file which can be found easier, i.e simulator uses old file "derivedData"/name.storyboard to operate.
Solution: Just rename the storyboard file, in navigator and in targets/general.
This error happened to me for the first time when I had multiple copies of a project on my computer. For whatever reason, the fact that there were multiple copies were making it look as if the storyboard had not been updated between copies and in some cases the code was not updated. I thought I had forgotten to throw the right copy on my flash drive before going home, but it turned out it's an XCode error.
Delete any multiple copies using the same name, restart XCode and open your most recent copy. Extremely bizarre, but I will probably use BitBucket or GitHub from now on instead of throwing it on a flash drive.
Deleting
~/Library/Developer/Xcode/derivedData/
worked for me!
I just have the same problem after localizationMy solution is clicking Product, Clean build folder. Then it will be fine
The storyboard on the simulator was what it should have been. The storyboard on the device would not update. I had to delete the application from the iPhone and then re-run it on the device in order to get the Storyboard to update on the device. Fortunately for me it was only test data, but I was using Auto-Layout on one view and went back to manual. I think that's what caused the issue for me.
I find that removing and adding storyboard file back doesn't work in my case, also it has side effects like it will automatically add a main nib entry into App's plist file (which subsequently makes the App fails to launch in iPhone simulator).
I don't want to try to delete the application from the simulator since I have many files under the Document directory of the App.
At last I find another way that works well: simply delete the "/Users/$username/Library/Application Support/iPhone Simulator/7.1/Applications/$app/$yourapp.app" file. The files under Documents directory are untouched.
(I have localized my storyboard as well.)
I found this same thing happened with Xcode 6.1.1 if I happened to have copied a project; the new project run in the simulator was actually still reflecting the old, original project.
In my case the problem was with how the default area was set up for derived data (essentially the location where the binary files go for a build). Mine was set to legacy and the simulator was using the wrong project, even after a clean. The solution was to go to Preferences->Locations, press Advanced, and change the location from Legacy to Unique.
I get this too when using localized storyboards - Run in Xcode just refuses to install the latest version of the compiled storyboard. I think it is something to do with the way Run copies changed resources across to the device - it does it differently than other forms of on device app installation.
The quickest way to get past this without deleting the app and losing any data is to:
Generate an Archive build in Xcode
Export this for Adhoc deployment
Double-click on the generated IPA to add it to iTunes
From the device page in iTunes force an update to that app
In order for iTunes to see that you have a new version your app build number will need to be incremented (if you don't do that already), before generating the archive.
I find this method means you don't have to delete an app off the device, you're just forcing it to install the entire install package rather than a diff which is what I think Run is doing.
I'm not sure what causes this, if it is a localized resources bug or what, but this is still a problem in Xcode 7 for me.

trying to remove audio file from project

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.

Xcode Build and Archive for Enterprise Distribution builds old archive

I'm working on creating an app for in house distribution enterprise level. I've created the app and tested hosting it on my own server and even getting the click to install working. Now though I have some updates to the app, I make the edits and I even see them in the simulator. When I build and archive the app things seem fine, then I go to the archived project in the organizer window, click the share button and distribute for enterprise, I enter details such as the ipa final url and the app title and then ok & save. Then I upload the app to my server and update any links to point to this new app. The click to install still works properly, but it installs the old version of the app. I've even tried this on a new device. Is there some step I'm mission that tells Xcode some version to build? If so, I don't get is how the simulator shows the update fine, but the archive that is built is not showing the latest code. The app I can find in the simulator dirs is 9.4MB in file size, but the one that is saved after build and archive is only 1.4MB (the update involves a lot of added images), so is the build for archive is not even getting the new files?
if a clean won't work, try completely removing the derived data folder.
the default location is in /Users/you/Library/Developer/Xcode/DerivedData . if you haven't played with the DerivedData location in preferences, this is likely where you'll find the sub-folder containing the cache.
when i encounter a situation similar to the original question (retaining items i've deleted, or similarly missing items i've added or holding onto project icons i've changed), i perform a clean on my project, close it, hit Delete… in the organizer, possibly even remove it from the organizer, possibly even remove from disk and then re-checkout from git if you have it under version control in this way, then re-open the project from scratch.
I figured it out and thought I should post it in case it helped someone else.
I cleaned the project.
Build > Clean - not 100% on what "Clean" is supposed to mean/do, but it allowed the project to build from the current files rather than the old files somehow.

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