.xib file location - xcode

I am literally following a iOS Programming book (iOS5). it says that there is a xib file in the navigator but I am unable to find it. I am using xcode 4.5. I am really confused as this is my first time trying out iPhone development or anything in xCode if that matters.

This depends on which kind of project you are creating. For example a project created from the "single view application" template will create a xib file.

Related

ViewController.h and ViewController.m are not created automatically

I am studying by self for application development.
OS: MacOS
Software: Visual Studio(8.10.11 - build 8) for coding
Xcode(13.1)
I am referring a help article below published by Microsoft since I am using Visual Studio.
Ref; https://learn.microsoft.com/en-us/xamarin/mac/get-started/hello-mac
However, I am sticking at Outlets/Actions section.
I open storyboard on Xcode, and tried to sync between UI change to ViewController.h file.
I recognized that I do not have .h nor even .m file.
Did I have to create ViewController.h file manually??
There was also a sentence like this below.
This stub .h file mirrors the ViewController.designer.cs that is automatically added to a Xamarin.Mac project when a new NSWindow is created. This file will be used to synchronize the changes made by Interface Builder and is where the Outlets and Actions are created so that UI elements are exposed to C# code.
I researched NSWindow but I am super newbie on App Dev. So I am about to lose my mind and wasting my time for a long (T_T)
Could someone help me here?
This Visual Studio ver will not create .h/.m file anymore?
Kind regards
I am sorry for this dumb question.
I still do not have any header file nor m file.
However, when I double clicked storyboard, I saw header and m file.
I used to open storyboard file on Xcode because I did not have an option to open from Visual Studio even though I right-clicked storyboard file like "open -> Xcode interface builder" stuff.
Anyway, the issue was resolved.
Case closed.

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

How to use Xcode to design interface iosopendev?

I have Xcode 4.4.1 installed on my system.
I recently installed iosopendev to develop apps for jailbreak. It integrated well, now I can see the option for iosopendev in new project menu.
My question is, how do I design the interface visually, like using storyboard for a jailbreak app, and which template should I select for that?
For starters, I selected the Cocoa Touch Library Template, but it didn't have a storyboard or xib.
I would highly appreciate it, if someone could elaborate the steps and method for designing apps for jailbreak visually using Xcode.
P.S.- I have searched a lot on the internet and didn't find anything useful and hence as a last resort posted a question here.
Two ways you can create UI apps in Xcode that can be used with iOSOpenDev:
(1) Select an Xcode template and refer to https://github.com/kokoabim/iOSOpenDev/wiki/Convert-to-iOSOpenDev-Project to convert it to iOSOpenDev.
..Or..
(2) Select an iOSOpenDev template (that produces a bundle binary), add XIB file(s), create a Copy Bundle Resources Build Phase and drag-and-drop that new Build Phase so that it is above the Run Script Build Phase that runs the iosod script.

Migrate xib file to Xcode 4.4

This should be an easy one, but surprisingly I could not find any information about it being or not being possible to do.
I have some .xib files created in older versions of Xcode/Interface Builder and I would like to use Xcode 4.4's new features but so far I've only been able to achieve this by deleting the older .xib files and creating new ones from scratch.
You may need to update the older xib files' development target. Select the xib file from the project navigator and open the file inspector. In the file inspector's Interface Builder Document section is a Development menu. Try updating the development target to Xcode 4.4 and see if that allows you to take advantage of the new Xcode 4.4 features.
If updating the development target doesn't work, you'll have to provide some more information about the problems you're having and the features you haven't been able to access.

Can't create iPad XIB with Xcode 4

Alright, I have a problem on my hands. I'm trying to convert my project to a universal app for the iPhone and the iPad. I'm trying to make iPad-specific versions of my XIB files. As it's not possible to Create iPad version using autoresizing masks in Xcode 4, I assumed I'd just be able to pop my XIB into Xcode 3's version of IB, and let that do the magic. No dice. Here's the error I get when i try to open the XIB file in IB:
To be honest I don't know where to proceed from here. I guess I could just resize my views manually, but that's quite tedious and I don't really have the time to be doing that. Any ideas?
Alright, I figured out a rather convoluted workaround.
First of all, duplicate your original project and then select your project info. Right-click on your target, and select "Duplicate".
Xcode will then pop up this message. Select "Duplicate and Transition to iPad".
Now Xcode converts the XIB files for you, and presents you with an iPad resources folder.
Now open these XIB files in the Finder, and append ~ipad after the file name.
After doing so, copy these XIB files back into your original project, and then turn your project into a universal project by selecting from the dropdown in your target settings.
And you're done. I found that really convoluted, and I'm hoping Apple can fix this huge usability problem soon.
This should not happen. One way to fix this problem would be t completely remove the Xcode 4 Installation and re install it from scratch . And then re install it.
Use the following command to uninstall and re install Xcode 4
sudo [xcode-path]/Library/uninstall-devtools --mode=all
PS: If you are creating projects in Xcode 4 that you also want to open in Xcode 3 make sure you keep Document Versioning section to Interface Builder 3.1

Resources