Storyboard vs XIB - xcode

I pretty much a rookie in XCODE and almost all of the tuts availible are explaining programming with XIB file with file's owner etc.. The newest version of XCODE only works with Storyboards, and I couldn't find anything which would help. So please, someone have to got a good tutorial I think. It would really help me out. Thanks
Sjors

when you create a project (File -> New -> Project -> select a template ex Single View..) remove the tag to "use storyboard" then you will get a xib file instead of a storyboard... now you can follow tutorials that use xib files :)
tip: if you follow old tutorials...allot of the time you also have to remove use automatic reference Counting because before Xcode 4 they all used manual method ( release etc)
Good luck!

Related

Accessing image from PaintCode in Swift

I'm thinking about buying PaintCode, because I wanna use it in my Swift projects. I downloaded the Trial version. The tutorials at the homepage are only for Objective C, but the explained way (http://www.paintcodeapp.com/documentation/stylekits) doesn't work with Swift.
Any ideas, how I can add the images from PaintCode to my xib file (for example to a toolbar item)? (I have a Cocoa project without Storyboard)
Paintcode works with Swift you just have to change the output.
You can choose iOS/Obj-c , OSX/iOS.
PaintCode works well with Swift. You only have to select the output as pointed by a comment before and export StyleKit to your project.

Adding multiple Cib / Xib files in Cappuccino

Currently I'm working on a product that uses the Cappuccino Framework and the Objective-J language.
I created my project using this command after installing Cappuccino: capp gen -t NibApplication Myapp
The Problem I'm facing is that I want to keep my code and GUI clean.
By doing so I wanted to split the GUI up in separate Xib / Cib (compiled version Cappuccino can read) and separate controllers, like I do with iOS and Mac apps.
I couldn't find on the internet or on the docs how to do so.
Also, all the examples (including the NibApplication template) contains only 1 xib file.
In short what I'm after is to load a controller, based on a XIB file which holds the window. All the outlets are connected to the controller I loaded.
Is there anyone who knows how to do it?
Thanks in advance and have a nice day!
The typical way to do this is to use a CPWindowController or a CPViewController for each xib you want to load. Here's what it might look like:
var myViewController = [[CPViewController alloc] initWithCibName:"mynib" bundle:[CPBundle mainBundle]];
This would load Resources/mynib.cib from your main bundle. Normally you'd also subclass CPViewController so as to give yourself a convenient spot for your control code.
Fixed it myself! I used this tutorial: http://vimeo.com/8948460
But instead of using atlas I used XCode. Just follow the steps but with XCode and you'll be fine if you want the above to happen.

Xcode 5 Link Document Type

Am following tutorial at
http://www.raywenderlich.com/1980/email-tutorial-for-ios-how-to-import-and-export-app-data-via-email-in-your-ios-app
To link a document type to my application so that my application is responsible for opening up of that document.
XCode 5 works very different... Under your Target, Info tab is a "Document Types" line... am not sure how to use this, is there a sample for me?
Thanks
I'm sure you've either figured this out or moved on, but a little tip for most of these tutorials: you can often download the completed code from the website. I did so, and loaded it up in Xcode 5.0, and it works fine. Here's a screenshot of the plist entries (that's under Resources/ScaryBugs-Info.plist) for Document and Export:
Another way to change the Document types in Xcode is via the Project Info (select the project in the Navigator, then the target in the projects and targets list, then the info tab). Here's a screenshot of what that stuff looked like for me:
Here's another very helpful link straight from apple support. Watch the screenshot they have under Example and literally replicate everything from this screenshot and just change their custom extension from catinfo to pdf, ttf, xml or whatever you like
NOTE: Make sure you test this on actual iphone / ipad and not on simulator.
https://developer.apple.com/library/ios/qa/qa1587/_index.html

How do I use the Core Plot framework with Xcode 4?

How do I install the Core Plot framework into Xcode 4?
This older tutorial has instructions on how to install it for Xcode 3, but I could not find any similar instructions for Xcode 4. What do I need to do in order to use this framework with the newer Xcode?
I made one here that followed what I did:
http://recycled-parts.blogspot.com/2011/07/setting-up-coreplot-in-xcode-4.html
Hope it helps!
It appears that I was unable to set up core plot project for the reason that I had corrupt example project which code I was using.
This are the steps:
open a project
add quartzcore framework
add other linker flags: -ObjC -all_load
add CorePlot.xcodeproj to existing project (drag and drop)
add sample class (from examples folder, drag and drop)
drag coreplot framework from added CorePlot.xcodeproj to linked frameworks
in IB
drop object and associate it to sample class
drop custom view to window and associate it vith CPTLayerHostingView
connect object and custom view
And hat is that (may sound complicated, but can be done in under a minute)
Steps can be taken in any order, except last few.
Everithing is very similar to instructions at: http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application except the way it is done in xcode4 is actually easier.
Here are screenshoots that clarify the above steps: http://www.optimae.biz/data/stackoverflow/coreplot.pdf
Hope this will help someone.

Xcode3 to Xcode4 code templates

can someone tell me how to convert code templates from xcode3 to xcode4?
I am reading article at http://iphonedevelopment.blogspot.com/2009/04/opengl-es-from-ground-up-part-2-look-at.html and author offers his OpenGLES code template, but I can't get it working in new xcode4, seems it have different format. Any suggestions?
Thanks in advance :)
I had the same problem, here is a list of the changes you need to do to make your xcode 3 templates works with xcode 4 :
First you have to move your templates to a new directory :
/YourUserDirectory/Library/Developer/Xcode/Templates/File Templates
(previously it was /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/File Templates)
Then you need to :
rename your templates from "*.pbfiletemplate" to ".xctemplate"
rename class.h into ___FILEBASENAME___.h (the class.m can stay unchanged)
inside all of your files change «FILEBASENAMEASIDENTIFIER» into ___FILEBASENAMEASIDENTIFIER___
Additonaly all the key words like «FILENAME», «PROJECTNAME», need to be replaced by ___FILENAME___, ___PROJECTNAME___, etc
«OPTIONALHEADERIMPORTLINE» needs to be replaced by #import "___FILEBASENAME___.h"
Hope this helps,
Vincent
Until XCode 4 is finalised, there's probably not much point in this. However, you can side by side install XCode 3 and 4 and the XCode project format is compatible between them. Hence, I'd just install the template in XCode 3, create your new project(s), then open the results in XCode 4.

Resources