Interface Builder cannot find .xib - Xcode 5.0.2 - ios

I recently became interested in mobile app development and want to take my coding experience from elec. engring to the iphone. Im having trouble though. I am trying to compile my first app onto my phone (got it to run perfectly on the iOS simulator last night). However, upon compiling i get the following error:"Interface Builder XIB Compiler Error: Interface Builder could not open the document "xxx.xib" because it does not exist"
I've tried going into my target and setting Main Interface to xxx.xib and I still get the same error on both iPhone and iOS simulation. I've tried setting my interface to Xcode 4.6 and messing with the builds and views, still have the same issue. I built it from scratch - same issue.
All help appreciated. I know the default is building with story board, but I am following a book I am happy with and I want to go through it with the .xib because thats what the book uses. Thanks -

Select your project (blue icon) in the project navigator then choose:
Build Phases > Copy Bundle Resources
Make sure your xib file is on the list. You can add it by clicking the plus (+) icon on the lower left.
UPDATE:
Consider opening a new project as a sanity check. Change the background color and verify that it runs in the simulator. If it does then this will point to a project settings issue rather than an installation problem.
You may also want to look at the following walkthrough by Apple. Hopefully following the steps will help illustrate anything you might be missing.
Apple also has a latest tutorial that I recommend you walkthrough. After completing please let me know if you are continuing to have this problem. The number of potential problems is greater than simply walking through the 15 min tutorial.

Related

Annoying XCode Source Kit bug with multiple targets

I'm struggling with this problem for nearly half a year now with multiple XCode versions and Macs.
I can't reproduce bug steps exactly but the things go off when project has multiple targets like for Mac and iOS.
First of all XCode declines to take #if os into account and always highlight syntax only in one type of sections. E.g. if I have os(iOS) and os(OSX) somewhere it will chose only one and highlight only them.
Same goes for autocompletion. Things just not working in that type of projects.
I really dont know what to do since developmenet process turns into struggling. I dont want to split my project into multiple one, I'm happy with multi-target setup.
Is there a way to fix that?
Almost a year late.
Anyway I faced the same situation where a multi target OSX/iOS application in Xcode did not take into account the #if TARGET_OS_IPHONE conditional and failed to autocomplete method names from framework only showing the iOS variant.
Found a solution, based on this blog entry : you have to clearly state the Framework search path on each target in Build settings
Edit: This line was present in the iOS target settings. I copy/pasted it to the MacOS target in Xcode where it was automatically adjusted to the right path.
Edit 2: Loosely related but if you run in trouble with interface builder picking wrong classe files see this answer I just posted in another old thread.

Why am I getting an unavailable declaration using framework

I'm making a swift .framework, but I'm running into what I believe is a build problem. So I've simplified everything to isolate my troubles. I've attached a screenshot of my newframework.framework project (top) and my example usage of the framework (bottom). The problem I'm having is that Whatever class is unavailable when I include newframework.framework. I can confirm that Whatever.swift is indeed included in target>>buildphases>>compile Sources
What could cause this not to work?
EDIT - Adding App Build phases screenshot
Your problem, as we figured out in comments, was that you were building your framework for "Generic iOS Device" and building your app for the simulator. Xcode can't make the app build without matching architectures, so you need to choose one over the other or produce a framework that includes every architecture.
(This was posted to help people who come here from the future find the answer quickly. Hello, future people!)

Cannot run program in Xcode

I've recently made an app and could successfully run and test it until this suddenly happened,
fail to run program
It doesn't looks like an issue, but the "run" button is unavailable. Usually it should look something like,
successfully run a program
As in the image, first there are two buttons, run and stop, after that there is the name of the program/app and its icon (fun facts) and then the iphone simulator it will run on (iphone 6). On the image on top, the failed to run program attempt, it is totally different, first the run button is disabled, second, the icon is a gear and not the app icon, and third, there is no simulator, it appears "my mac".
I don't know why this happened but this cannot let me run the app. I searched in the apple documentation and didn't found anything. If someone knows how to solve this please tell me.
The simplest solution is to rebuild your project from scratch. This is not difficult because you still have all your code. So, start with a new project from the iOS template. Copy your code from the old project into the new project.
And try to avoid renaming your project from now on, because there is a bug in some versions of Xcode where it crashes and destroys the project in just the way you describe in your question.
And update to the latest version of Xcode, because it is less likely to cause this problem (though in fact I have not found it reliable for renaming projects even now).

Extension project templates not appearing in Xcode 6

I'm not sure if I am the only one experiencing this program, but I have tried searching and have not been able to find anyone in my current situation. I downloaded Xcode 6 beta and was interested in Extension programming for iOS 8. However, I have been unable to locate the extensions in my project templates when creating a new project in Xcode, I saw a YouTube video (unrelated to extension programming) but I did notice that the option was not there for the said video. Now, I have had a look through the contents of the Xcode 6 beta package and have been able to locate the actual templates themselves, so I have no doubt they are present, it just seems that they are not actually being loaded.
For the record, I also downloaded some example custom keyboard code from GitHub in order to see whether Xcode will recognise it and it does, going as far as actually displaying the 'E' icon beside the build target. I should also mention that I do have a build of Xcode 5 also present on my machine.
Is anyone else experiencing this issue, or does anyone know how to overcome it?
Thanks
You create a extension by creating a new target in an existing project.
Check this link for more information
I had the same problem. The solution was to not try to add the extension in File/new/File... menu but in File/new/Target... menu.
You can add extension to any existing project.

OpenGL ES Programming Guide Particles example

I am trying to make the particle system example given in the book OpenGL ES programming guide to compile in iOS 6 but I don't seem to be able to make it work. For reference here is the web site of the book:
http://www.opengles-book.com/
The code can be downloaded from Google Code, see instructions below:
http://code.google.com/p/opengles-book-samples/wiki/Instructions
The code is in chapter 13.
Has anyone came across this and were able to make it work in iOS 6? I had made some modifications but still no joy.
Follow these steps:
Open "Common.xcodeproj" located in "/opengles-book-samples/iPhone/Common/"
Select to build for device or simulator and build.
After Build Succeeded close the Common.xcodeproj.
Open Finder and from the menu Go>Go to Folder... type without quotes "~/Library/Developer/Xcode/DerivedData/" and find the folder called "Common-bkoronpjvpvwbxgdgxbwiukcqwaz" inside folder go to : /Build/Products/ and copy "libCommon.a" to ParticleSystem project.
Build&Run particle example.
That's it. :)
Good luck.

Resources