How can I make my xcode project automatically select the correct Xcode version when I double click on it? - iphone

I have multiple versions of XCode installed on my MAC. When I install a new version of the SDK, I noticed that I can't no longer double-click on the project file for the newer version of XCode to launch the project. I have to constantly do a right-click and then select the newer Xcode version. (multiple versions now show up when I do a right click). I thought maybe once I right-click selected the newer Xcode app once, it would remember, but it does not. Is there a way to make it so that my project will ALWAYS launch with the newest XCode when I double-click..or must I constantly do a right-click and select the right Xcode version?

Right-click on your project and choose Get Info, then where it says Open With, choose the correct version of Xcode you want to open it. This may not be the official way, but it will work as expected. Also, doing it this way, and clicking on the Change All... button will change all of your Xcode projects to open with the one you selected.

Do a right click on your .xcodeproj file. Then select the "Open With" option.
Then select "Other" and navigate to the path the the specific version of Xcode you want to be selected automatically for this project. You will need to navigate to the correct xcode.app file. To help you find the right file, note that when you do a default install of Xcode, it gets put into the Macintosh HD->Developer->Applications folder. However, if you have installed multiple versions of Xcode, navigate to the specific version you have installed and then select the appropriate Xcode.app file. Make sure you select "Always Open With" in the window you are using to select the app.
Once you do this, you can finally double click on the project and the correct Xcode version will now launch.

Is there any reason to have to old version on your MAC still?

Related

new to iOS - not able to download and run project

I downloaded the Flashlight project from this trusted site , in xcode i clicked on "open other" and choose this project. But when I run it it gives me the error:
the run destination my mac 64-bit is not valid for running the scheme 'Flashlight'
the scheme 'Flashlight' contains no buildables that can be built for the SDKs supported by the run destination my MAC 64-bit. Make sure your targets all specify SDKs that are supported by this version of Xcode.
I tried this: Autocreating schemes (Scheme > Manage schemes > Autocreate schemes)
I then closed and re-opened xCode. still got same error.
ok, the issue is not in the schemes, it is in the build settings of the project and its SDK missing.
1.click the project on the left side of the Xcode when your project is open.
2.then on the right side navigate to the build settings.
3.under the base SDK pane, click on the right side and open up the drop down menu.
4.then select the type of the SDK you want.
from there you can select to run the project on the mac or iOS.
now this project is missing some basic framework when its run on mac 10.8. so i suggest you run it in iOS.

How to change the default xcode version that is launched...?

I have both xcode 3.2 and 4.0 version installed on my PC but my problem is whenever I open a project, it opens up with xcode 3.2. Although I have the option of opening my project with open with->xcode 4.0 , I want to change the default Xcode to 4.0. Is there any way it can be done?
Use Finder's context menu (i.e. right click on the project) and choose "Get Info"
In the window that pops up is a section titled "Open With" - use that to choose the appropriate version of Xcode, and then use the "Change All" button to specify that it should be used for all projects.
On my machine I renamed Xcode.app for Xcode 3 to Xcode 3 which makes it easy to distinguish between the two versions.
First right click on the Project whichever you want to open.
Now select the openWith option and choose "Other" option.
Now choose the Xcode 4.0 that is installed on your MAC.
Select All Application from Enable Menu and also check "Always Open With Option".
Then Click OK.

I have installed phoneGap lib but am unable to run the app

I have installed phonegaplib for ios, I created one test project using phoneGap based on application template, but in that, phoneGap.framework is in the red color. I think it is missing. So where can I get this frame work, can any one help me?
Are you sure you're following the official guide?
Create a PhoneGap project (Xcode 4)
Launch Xcode, then under the File
menu, select "New Project...".
Navigate to the "iOS" section, under
"Applications" - then in the right
pane, select "PhoneGap-based
Application"
Select the "Next" button, name your
project and company idenfifier, then
select the "Next" button again.
Choose the location where you want
the new project to be.
Run the project at least once to
create the "www" folder in your
project folder.
Drag and drop this "www" folder into
your project in Xcode, and add it as
a folder reference.
Modify the contents of the "www"
directory to add your HTML, CSS and
Javascript.
Reference 1: PhoneGap iPhone - Build and install the Installer Package
Reference 2: Video: PhoneGap Installer - Xcode 4 Template [HD]
Sounds like you are using XCode 4, which is not fully compatible with PhoneGap's default settings. Use this link to have PhoneGap generate a compatible project for you:
https://build.phonegap.com/generate

linking gdata to an xcode 4 project

I'm having major issues linking gdata to a project after upgrading from xcode 3.2.5 to xcode 4. I would like to know if anyone is having similar issues, and what did they do to resolve them. i am using gdata version 1.11 which is the latest on their site. The project works flawlessly on 3.2.5, thanks.
I have created a workspace for my project, and then added the gdata.proj to it. So I do have all the files linked by reference. But project files which include #import "GDataYouTube.h" do not see the file. I get "No Such File or Directory"
Good News... resolved and tested, all working follow these steps...
Open your project in xcode 4 from 3.2
click File -> Save As Workspace
in project navigator on the left, collapse your Project if you see all the files
below your collapsed project, in the empty space right click or control click -> Add Files to...
select the project file you wish to link to, leave Copy items unchecked, click Add
Now you will see 2 collapsed projects in your Project navigator, expand both
Now what I didn't know I had to still do
Drag the files or folders you want from the second project to your main, make sure your Main project target is selected in the options, and I also have group selected then click Finish
You are good to go, you might have some warnings about your second project and its targeted SDK. Fix those by clicking the project name in the Project Navigator -> Build Settings -> Base SDK to 10.6, Deployment Target to 10.5

Frameworks are 'red' in Xcode

I downloaded a project developed by Apple employees ( who taught course at Stanford on iPhone application development). Strangely , the frameworks are red.
http://img.skitch.com/20100730-kcjun96mp2pxnpg7w3x6njw57.jpg
I tried to locate coreGraphics.framework and UIKit.framework to add them again but i couldnt find them either.
Taimur
The red text indicates that the actual files are not at the path that the project has for them.
Get info on the framework and look under the General tab. The first section shows the name and path of the framework bundle itself. The most common cause of a problem with system supplied frameworks is that the path type has been changed to something that breaks the path. The default setting is Relative to Current SDK. Change the path until you get one that leads to the actual framework.
If you have the developer tools installed in a custom location, you are more likely to run into this problem. If you copy a project from someone with non-standard settings, you can encounter it as well.
Are you building for a Simulator or for Device?
Try building for Device.
Found a way to fix this automagically:
Right click your main Xcode project file (the blue one at the top ),
Get info,
'General' tab,
At the bottom, set 'Base SDK for All configurations' to your desired one.
Done!
Steps to fix this issue in M1 Macs:
Install "sudo gem install cocoapods-deintegrate cocoapods-clean" to install deintegrate if not installed.
Run "pod deintegrate" in terminal in your project folder to uninstall all pods.
Run "pod cache clean —all"
Run "pod install"
Go to Project Explorer Select "Pods" in blue
Select the each pods in the target section
Search for "Excluded Architecture" in Build Settings Tab under "All" sub category.
Add "Any iOS Simulator SDK" in both debug and release and set the value to "arm64"
Repeat this for each Pod with the error "Framework not found".
Clean Build the project.
#Taimur Hamza - Its happen (red color) following any one of reason,
Your downloaded project may be miss some required files
Before run the application at first time.
so, first you have to find that above reason is happen and try to solve via copy the framework from another running project and paste it your project.
I had faced this problem before. I got over it by copy the missing (in red) framework from my friend's Mac then copy it to the Framework folder.
This is the path of my framework folder:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/System/Library/Frameworks
You may need to change the path depend on your system or your sdk version.
Most likely you decided to remove some of the frameworks you don't need and you deleted them but selected "Move to Trash" instead of "Remove reference".
The problem is that this framework was not included in your project's folder. It sits in a System folder when it can be used by multiple projects. So not only did you cause the current project not to compile, but also all projects on your computer.
If you have any frameworks left, you can right-click on them and check "Show in Finder". Than you can find your deleted frameworks in the trash (if it's not wiped already), and put them back in the system's Frameworks folder.
If you can't find this folder, for me it was here:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.0.sdk/System/Library
Of course, when you go in Applications folder and select Xcode, you have to right-click on it and click "Show Package Contents".
If you deleted your frameworks even from the trash, than I guess you could re-install Xcode...