Adding outlets and actions in XCode 4 for a Monobjc Application - macos

I've been following the tutorials in http://www.monobjc.net/ in order to do a small Mac app using monobjc for the GUI. However they are using Interface Builder 3 in order to create the actions and outlets that are needed and I can't find a way to add these into the app delegate when I edit the xib file in XCode 4. Is there a way to do this?

I have updated the documentation to include a step-by-step guide on how to create action/outlet.
I hope it is clear enough for you to go with Monobjc/MonoDevelop/Xcode.

Related

iOS 8 - Swift - Xcode 6 Beta - working without interface builder (no nibs and no storyboard)

I have been searching a lot in the inter webs and Stackoverflow. Unfortunately there doesn't seem to be much info around the new Xcode version, iOS 8 specifically with Swift and working without the Interface Builder.
The Templates to choose from as a starting point now does not have the option to start with an empty application. The least setup you have is to take the single view application, which already gives you the ViewController and a basic Storyboard.
I hate storyboards and I hate nibs. I want to do everything in code. I tried to delete the storyboard file, instantiate the window, set the rootViewController and make it visible just like in the good old days. the ViewController initializes without nib and bundle.
The result is this a SIGABRT with this error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'Main' in bundle NSBundle </Users/[username]/Library/Developer/CoreSimulator/Devices/BC38B690-D30E-44FB-93B1-AB861D03B414/data/Containers/Bundle/Application/B6C160C8-67E1-4A74-9F81-55D097262050/blabla.app> (loaded)'
I sure hope that I will still be able to do UI without Interface Builder. Anyone has an idea on how to progress? I remember I was able to use an empty application with the previous Beta versions of Xcode 6.
In my opinion storyBoards are awesome. They make the development cycle easy and quick. But if you do not want them you can create a Single View Application template.
Delete the storyBoard and Follow these steps
1) Go to Your Target
2) Deployment Info
3) Main Interface -> Delete Main and keep field empty
It will not load a storyboard or any view. Now it's your responsibility to load Window and create rootViewControllers and views programmatically
The method outlined by codester is a good solution, but (in Xcode 6.0.1) the final step - deleting "Main" from the Main Interface section - would not work for me; I would delete the string, but as soon as I navigated away from that page or tried to run the app, the field would be repopulated with "Main". I ended up having to manually delete the "UIMainStoryboardFile" key/value entry in the applications Info.plist.

Xcode - Navigation controller tutorial needed

Does anyone have a good navigation controller tutorial for newer Xcodes that still uses xib file instead of storyboard? I've been searching everywhere, and what I've found either is for Xcode version 2.0 or either uses storyboard.
Check out this: http://www.techotopia.com/index.php/Creating_a_Navigation_based_iOS_5_iPhone_Application_using_TableViews
Should give you the basic idea... Written for iOS 5 though, so some functions might need updating

How to I create a MainWindow.xib in Xcode 4.2 in an iOS application?

I am just starting out learning to build interfaces, but the book I am following is a little dated and it says that Xcode should create it for me with my new project, however it didn't. So now I need to link my buttons to my app delegate, but I can't because it isn't showing up when I right click on my buttons. And yes, I did define my methods and instance variables.
Xcode very much will create a MainWindow.xib if you choose Cocoa Application as the project type. Check to make sure you aren't either creating an iOS project or a command-line tool... both can be easy to accidentally select when you are just starting to learn.
(FYI, I just verified in Xcode 4.2.1 that a MainWindow.xib was created for me.)

Migrate from iOS 4 to iOS 5 .

I have an application developed in iOS 4.3 and XCode 4.
What are the steps that I have to follow to migrate it to iOS 5?
Do I have to upgrade XCode?
Thanks.
you'll need xcode 4.2+ - basically get the latest one on the app store. in theory, you shouldn't have many problems (if any), but there are some subtle changes which can catch you out.
off the top of my head:
modal view controllers don't seem to set parentViewController - instead you can use presentingViewController e.g. [[self presentingViewController] dismissModalViewControllerAnimated:YES]
viewWillAppear/viewDidApear/viewWillDisappear/viewDidDisappear notifications have changed in that in the past you didn't get them if you manually added views etc, but now you do. there's a good blog post on it here: http://gamesfromwithin.com/view-controller-notification-changes-on-ios5
the only other thing that i can think of that i ran into was the location where xcode stores "Derived Data", but that was only an issue going from xcode3 -> xcode4 (and we were an edge case), so you shouldn't need to worry about that.

How do I initialize IKImageView?

I am completely stumped with this one: I'm new to Xcode, coming from Windows. I create a brand new Cocoa app, place an IKImageView in Interface Builder, save and launch the app. Xcode shows the app icon bouncing forever, never launching. If I trace into it I get application crash right away.
I've downloaded examples from Apple but I cannot see how they initialize IKImageView, if that's what I'm failing to do. I've been searching for a solution for hours. Help?
The problem is that you are not including the required frameworks that are used by IKImageView. Just follow the instructions that are found in the Image Kit Programming Guide, in particular the section labeled Using the Image Kit in Xcode and you should have no problems.

Resources