Compiling Swift source files - xcode

When I run the Project, Xcode is always show the message "Building AppName | Compiling Swift source files", without anything. How can I know What wrong with project? thank you!
enter image description here
Xcode Version:7.1.1(7B1005)

It's because your Xcode has option enabled Automatically Refresh Views. To stop that:
Open any XIB or Main.StoryBoard in your project.
From the top Menu bar, select Editor > Untick Automatically Refresh Views option.
From now onwards, it will stop refreshing view.

Related

How to show storyboard instead of text

enter image description here
Im a noob when it comes to this but, I wanted to show the storyboard file that I made instead of the "Hello world" when I launch the app. Pls Help..
You created a SwiftUI project in your screenshot. That's why you have code instead of a storyboard file.
The fix is to choose Storyboard from the Interface menu when creating the project. Then choose File > Add Files to ProjectName to add your storyboard file to the project. Xcode defaults to using SwiftUI for new projects so you have to explicitly choose Storyboard to use storyboards for your app's user interface.
If you don't see the Interface menu in the second step of creating the project, make sure you didn't select a Multiplatform project. Multiplatform projects don't have the option to choose a storyboard for the user interface.

Xcode 13 application projects open as text instead of project settings editor

After upgrading from Xcode 12 to 13, when I open an Xcode workspace with multiple application projects and click/select a project in the Navigator view, Xcode opens the project as a text file instead of the projects settings view (the one with multiple tabs and target definitions).
By the way, similar problem happens when I select a .plist file within the Navigator - it opens up as xml text file instead of the Property List Editor spreadsheet-like view.
Is there any way to fix it?
Updated answer:
Menu Bar: View > Hide Code Review
Original answer:
I haven't found any other workaround than:
committing changes
removing repo
cloning it again
Then I was able to checkout the branch and continue in work.
I had this issue and found a button which switches the mode:

Edit GUI without using base internationalization

I set my Xcode 5 project to use a build target of OSX 10.6, unchecked "Use Autolayout" for MainMenu.xib and followed this answer to turn off base internationalization. This resulted in my MainMenu.xib file being removed from my project. When I build and run my project the window layout is how I left it, but going into finder, opening MainMenu.xib in Interface Builder and changing it's layout does not effect my project when I go to build and run it again.
How do I change the GUI for projects set to a build target of 10.6?
Can be added again to the project by:
Drag MainMenu.xib from Finder to the project files panel in Xcode.
A dialog will open, select copy items (if needed), created folder references, and add to the project's target (not "test"), click Finish and it should work!
If a more complete answer is added, I will best answer it instead of my own.

The document "XXXX.xib" could not be opened. Could not read archive

After opening my project in the Xcode5 developer preview, errors appeared against a few .xib files when I tried to open the project in Xcode 4.5. The error text was:
The document "XXXX.xib" could not be opened. Could not read archive.
Please use a newer version of Xcode. Consider changing the document's Development Target to preserve compatibility.
The project's development target in Xcode5 appears to be iOS 5.0.
Looking at the source code of the .xib files with errors, it is clear that the .xml structure for .xib files in Xcode5 has changed quite dramatically, and it needs to be reformatted to be backwards compatible.
Is there a way to set development targets for specific .xib files? Does anyone know how this error can be resolved?
Many thanks.
Just open Storyboard in XCode 5, into right panel and "File Inspector" tab do:
edit your "Interface Builder Document" like follow:
Save it and open in previous XCode.
First of all open project with Xcode5. and then
select XXX.xib find Interface Builder Document
Opens in Xcode 4.6(if is 5.0)
close project
open it with 4.6
A better and easier solution that works even if your project isn't under source control can be found here (mine):
Just installed xcode 5 and have missing storyboards
Hope that helps.
It's a current problem when you open your Xcode 4.6 project with the new XCode 5.
To reuse correctly your XIB with Xcode 4.6 :
1 Open your project with XCode 5
2 Select your Xib to restore
3 In the File Inspector Section, in "Interface Builder Document",
select Xcode 4.6 in the Development's version of Document Versioning
4 Build and close
5 Reopen your project with XCode 4.6
It's possible to have some regression with elements width & size in your XIB, but it was restored successfully.
Cheers,
well obviously you created your project prior to the new xcode developer preview. then you tried opening your project with the new DP and boom, it automatically changed everything in your xibs to be able to present your xibs in a higher version. easy to fix. with your xcode 4 ios 6 open the same project, then right click on the name of the xib that is not opening and select source control and from there select discard changes. that should return the xib back to the shape it was before you opened it with the new xcode DP.
let me know if you need more help but that should take care of your problem.
First you have to open your's project with newer version of Xcode.
Right click on XXX.xib file and select "Show File Inspector."
Go to Interface Builder Document.
Change Development option with older version of Xcode.
Once I used to manage a project with XCode 5 xibs in XCode 4. I split xibs for each XCode version and made this build script that compiles xib to nib and place that nib them inside the app
#get SDK version
SDK_VERSION=$(echo $SDKROOT | sed -e 's/.*iPhone\(OS\)*\(Simulator\)*\([0-9]*.[0-9]*\).sdk/\3/')
if [ $SDK_VERSION == '7.0' ]; then
echo 'Current SDK is 7.0'
ibtool --compile ${TARGET_BUILD_DIR}/${TARGET_NAME}.app/output.nib ${PROJECT_DIR}/ProjectFolder/input.xib.xib
echo 'Copied nibs to' ${TARGET_BUILD_DIR}/${TARGET_NAME}.app
else
echo 'Current SDK is not 7.0 (SDK is' $SDK_VERSION')'
fi

Ignore "Attribute Unavailable"-Warning in Xcode4

I'm using a lot of "custom identifiers" for Toolbar Items, which is fine in Xcode4, but it gives me a bunch of warnings when I build the project:
Attribute Unavailable
Custom Identifiers in Interface Builder versions prior to 3.2
Is there a way to ignore these warnings in Xcode4? It's pretty messy when I search for "real" warnings and errors.
Click on your xib file. On the properties you will see the following section:
.
Where it says "Development" change that to Interface Builder 3.2 and you should no longer receive those warnings.
UPDATE for current iOS Xcode users:
In iOS 4.3 - IB is built into the IDE, and on the right after selecting the xib file there will be some icons, the first icon is called "File Inspector" (looks like a page with a fold in it) that is where the section resides (see below).
I am running Xcode 4.2 build 4C199.
Click on xib file,
on the right, click on Utilies View
Click File Inspector. As tony.stack mentioned look under "interface BuilderDocument"
set Deployment = "Project SDK version"
set Development = " xcode 4.2"
Even if you are running xcode 4.2, the Development is set to default 4.1, So you get that warning.
Have you tried looking at the "Document Info" window in Interface Builder? You can set supported versions there.

Resources