Can't make Xcode 4 run a barely empty project using SDK 4.2 (runs fine in 4.3) - iphone

I created a blank NavBar project and only touched a couple lines or so on one of the view controllers. I tested it fine in the 4.3 iPad and iPhone emulator but can't make it work for 4.2 at all. I get an error saying:
The selected run destination is not valid for this action.
This is what I have on my project settings:
Usually in XCode 3 that was all I needed to change but I guess I'm missing some setting in XCode 4.
What could this be?

#pokstad, you are right. I was looking at the wrong place indeed!
Choosing the target and changing the SDk there did the trick.
Thanks!

I really had troubles with this and none of the hints helped.
Finally I got an error message that pointed to an old file in the build folder, in the end a simple clean did resolve my issues (shift+cmd+K). It compiled fine. So remember to clean your current build after you changed the build settings in Xcode4.
This may be obvious, but at that moment it wasn't obvious to me.

Related

xcode 6 symbol navigator shows each class twice

Looking at my project in the symbol navigator view, I noticed each class listed twice. They are identical, but the code runs fine, what is going on?
Even if Xcode 6 isn't in Beta anymore, there are still a lot of issues(Editor stops working etc.). In most cases these errors can be resolved by simply restarting Xcode.
If that doesn't help you, try to Clean your project: Product->Clean. Also you could clean Xcode manually by deleting all files inside ~/Library/Developer/Xcode/DerivedData

Xcode 4.6 builds, runs and finishes instantly (simulator iOS 6.1)

In xcode, I tried to add a tap gesture to my app and when I built it, it started a problem with Xcode. It goes from building, 'running on iPhone 6.1 simulator' to 'finished running on iPhone 6.1 simulator'.
If the simulator is closed, it starts up with a black screen and you cannot click the home button etc. If open, nothing happens, the app doesn't install but the simulator doesn't crash.
I have tried the armv6 architecture 'fix' but that didn't work. I have also cleaned the project and project data. I have reset the simulator multiple times as well.
If I add the old files to my new project, it works up to a point (I copy and paste old files into new) but then the same happens.
Thanks for your help in advance!
NOTE:
New blank projects build and run fine.
EDIT: It still didn't work after undoing my previous actions, and the simulator is responding according to Finder, although the screen stays black
–––––––––––––––––––––––––––––––––––––––––
UPDATE
I had a folder named 'resources' in my application, imported as a reference which, following links from the thread #arthan.v supplied me with fixed the problem. What I did was rename the folder to files and reimport it.
Thank you so much, I spent 2 days trying to fix it before now!
Click the Center Button in View on your right hand side of Xcode.
In your Bottom bar, you'll see error: failed to attach to process ID 0.
Check these error: failed to attach to process ID 0 and Xcode compiles my App, but can't run it in the simulator
This sometimes gets fixed by these steps:
iOS Simulator > Reset Content and Settings ... > Reset
Xcode > Build and Run
I experienced the same issue after I had re-organized some code and renamed the workspace and project. Eventually realized there was an old version of my test app on the simulator's homescreen. I delete that and then everything was building fine again.
You might need to add the device to the provisioning profile. I experienced this on Xcode 6 and a real device.

Could not find a storyboard named 'MainStoryboard_iPad'

I cannot run my project in simulator because i get this error:
Could not find a storyboard named 'MainStoryboard_iPad'
But the storyboard is there.
Thank you
I managed to solve this problem in my iPad App through the following steps:
Checking the Build Phases
Editing the Info.plist file to add the option "Main storyboard file base name (iPad)"
Just like in this picture:
In my case, the iPad storyboard file was already in the project, and testing the app worked until I introduced what seems to be an unrelated bug... I fixed this by changing the filename in xCode for the MainStoryBoard_iPad to MainStoryBoard_iPad1 and changing the TARGETS > Summary > iPad deployment Info > Main Storyboard entry. For good measure also verifying the same in -Info.plist file and Build Phases accordingly... similar to #daniel-lima.
Hopefully, this may help others that did not fix based on above notes. This started after I fixed a CoreData related bug in a category-file. The issue was reproducible on another machine... and this fixed it on both machines.
My issue was only on iOS 5. The resolution was found at http://need-bee.com/b/2013/08/could-not-find-a-storyboard-in-xcode-5-for-ios-5-0/
To summarize:
In Xcode, open each story board file and uncheck "Base" under localization on the right hand side. It will prompt you to move to English. Select ok. Once rebuilt my issue was resolved.
Click target and there is Mainstoryboard with textfield. Click and select your storyboard named "Mainstoryboard_iPad" and clean your project and then run it.
Remove from the project all the StoryBoards and add all of them again, for me worked.
I got this problem today as well, for me, a Product > Clean solved the problem. After that, I can rebuild the app and run it inside the Simulator without any issue.
I was encountering the same problem as in the original question but for me there wasn't really a bug - rather, the storyboard which appeared in the project navigator as "Main.Storyboard" actually had a base name of "Main" in info.plist. So my attempts to use "MainStoryboard" and "Main.Storyboard" in my code were generating a crash, but once I changed it to "Main" it worked just fine - didn't need any of the elaborate workarounds above.
If the failure occurs after launch, check to make sure any references to a storyboard via storyboardWithName: refers to the correct name. You may have an incorrect name hardcoded in your binary.
In my case, I renamed the storyboard (based on a suggested workaround on stack overflow), but forgot to rename references to the storyboard in code. The symptoms were that changes to the storyboard weren't visible in the running application, but once I reset the simulator, the app stopped working completely. In that case, the old, stale copy of the storyboard was around at first and was used; once the simulator was reset, the stale copy disappeared and the "could not find a storyboard" message started appearing.

Xcode 4 is no longer showing me where my warnings are?

Xcode 4 has stopped showing me the locations of build warnings that I have. How can i get it to start showing me them again?
Make sure you're looking in the right place. On the left-hand side of Xcode (4), look for the little error symbol. Click it and enjoy your errors in all their glory.
If you click on the errors and it doesn't take you to the location in code, I think something must be messed up with your Xcode install. I remember you had another question earlier about Xcode problems, so it wouldn't hurt to uninstall & reinstall.
In Xcode 4.3.1. I have one project that doesn't show any warnings, but others do.
So it's not an Xcode issue I guess.
In the Issue Navigator (⌘4) be sure to clear the filter at the bottom left of the screen:
Just click on the x at the right, at the filter will be removed -- worked for me!
Check the below SO post
(iphone) Is there a way to see compile output of xcode4?
press command + 4 for issue navigator. (there are two filter here "By File" and "By Type")

tab bar controllers won't open in Interface Builder

I'm developing a new app but I've a little issue with Interface Builder...
I've installed Xcode 3.2.3 and iPhone SDK 4.0 GM.
When I create a new Tab Bar Application project in Xcode, opening the MainWindow.xib file in IB, the Tab Bar Controller won't open... I tried reclicking it but nothing!
I also uninstalled and reinstalled all developer tools but without any results...
Finally if I try to build and run the project in the simulator, the tab bar controller shows normally!
Can anyone help me? :)
It sounds like something similar to what I have experienced with my projects and the new sdk. Some of my IB files such as ones that contain UIViews when double clicking on them they refuse to open.
I haven't had to reinstall or nothing usually quitting IB and xcode and restarting helps I can't remember if I have done anything else to fix it. It may be an issue with the new 3.2.3 xcode as I don't recall having anything like this happen in my 3.2.2 build.
If it becomes a large problem for you have you considered removing the tab bar and rebuilding it? Just a thought. It may be troublesome to do so but if it fixes it and allows you to continue coding your project it would be worth it.
You said in your question that you're running iPhone SDK 3.2.3 with iOS4 GM. You should update your SDK, as the SDK is now at version 4.0 officially.
Otherwise, it sounds like your Xcode installation is somehow corrupted in some way. You may need a complete reinstall.