create application for Mac OS X from ios - iphone

I have iPad game application. Now I want it for the Mac OS x. This application is using Cocos2D and Gamekit framework. How can I create Mac OS X application. Gamekit framework is only available in ios. Any help is appreciable.

Its a very broad question. You are asking how too create a Mac App which can't be done in a single SO answer
Your best start would be to use the Cocoa Application template and work forward. The Google and Apple example code will show you many examples.
Depending on how much of your program is rooted in the UIKit based API will determine how easy it is to translate your program. The UIKit framework doesnt exist in Mac but most items have an equivalent NSThing equivalent (UIButton is similar to NSButton)
You will have to disable the GameKit stuff as that isn't on MacOS(yet)
The core of your troubles will be to place your Cocos2D view into a NSWindow hierarchy and possibly full screen it at launch.
Good Luck

Related

How to publish iOS Apps on Mac desktop [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Is there a way to convert an iOS app to a Mac OS X app?
I want to publish my iPad & iPhone apps on Mac desktop too, is it possible to do, if yes so for that what changes I need to do in my code.
Well you can't do it directly, since iOS use CocoaTouch and classe like UIButton, UITableView, UIViewController, ... aren't available on OS X.
You can use most of you code which is do not use any of the CocoaTouch components since Cocoa is also Objective-C.
You may think it in MVC direction. Your modal could be reuse, while the view need to redefine. And of cause the controller could be a bit different since it is a bridge between View and Modal.
rckoenes explain in framework aspect. If you think in MVC aspect, I think it could be easier to understand.
I hope it help. Thanks
iOS development is similar to Mac development but not the same: they use different GUI libraries (AppKit vs UIKit).
You could look into an open source solution such as Chameleon, which is UIKit reimplemented for Mac. It has some limitations but is also surprisingly impressive!
Otherwise, as others have said, you'll be rewriting your GUI.

Good Resources to learn Mac OS X Development for an iPhone Developer

I'm an experienced iOS developer, and know UIKit and most of the Foundation classes like the back of my hand. I've been toying around with a Mac App, but some of the basic app structure I'm not sure about. For example - in the iOS world there is only one "window" and a UIViewController for each screenful of information (for the most part). On OS X though, I see NSViewController which sounds like it may be useful, but then I also see things like NSWindowController which looks like it's tied in to the NSDocument stuff (which I'm not creating a document-based app) and some other things which make me second-guess myself.
Anyway, I'm not sure how to organize all my views, nibs, etc and I'm hoping maybe there are some good resources out there that can explain all the paradigms for OS X development to someone who is used to iOS development. Does such a thing exist?
I thinki Apple has a pretty good document describing the architecture of it's os X application. Look at the section Applications Are Built Using Many Different Pieces and The Application Style Determines the Core Architecture of the Mac OS X Application Programming Guide

Is iphone development very similar to Mac OS X development?

I'm learning (watching videos) on iphone development, and I am curious if this knowledge can be transfered to creating regular Mac OS X desktop applications?
i.e. is it MVC based also? is allot of the framework carried over also?
Just a little confused between cocoa, iOS and if they overlap.
P.S what is the shortcut keys to launch an iphone app? I can't figure out what that wierd symbol is.
In essence "yes". However, taking each of your questions in turn:
Whilst there's no UIKit classes on Mac OS X, the general development approach (and indeed a lot of the pure Cocoa class specifics) are identical. The run loop/event based nature of both systems are also effectively identical from a programming perspective.
As such, time spent learning the iOS way of doing things will pay off if you go on to develop Mac OS X applications, as you'll know parts of the Cocoa framework and what you've learnt of the UIKit bits and pieces will transfer across to the Mac OS X's NSxxx equivalents.
iOS and Mac OS X Cocoa development are both MVC, although it really depends on the programmer to keep things "pure".
In terms of launching an iPhone app, I've no idea what you're talking about, but at a guess, the "weird" symbol could be the command (a.k.a.: "clover") key that's a standard part of all Mac keyboards. (A bit like the Windows key on Windows keyboards these days.)
Incidentally, there's some general Cocoa/Cocoa Touch information over on the Apple site, although this is fairly high level.
iOS is the operating system (including the kernel, OS services, and the UI). Cocoa and Cocoa Touch are mostly the UI layer libraries or frameworks.
Mac OS uses the Cocoa UI frameworks. iPhoneOS/iOS uses Cocoa Touch UI framework. Both use (nearly) the same Objective C language and the same Foundation classes.
However, though the UI frameworks are similar in concept, they are not identical in terms of classes or "gotcha's". So you will have to rewrite pretty much all the UI code of an app, but using a fairly parallel MVC style.
You will also need to learn how to do manual memory management in Cocoa Touch if you are used to taking advantage of the garbage collection enabled implementation of Obj C 2.0.
But if you know one framework, you will be able to pick up the other much more quickly than starting from scratch.
For the record, Todd Ditchendorf has been developing UMEKit, a Mac OS X framework for creating iPhone-like user interfaces in Cocoa desktop applications.

ConnectionKit & iPhone SDK

I'm still getting my feet wet with the iPhone SDK, but I'm wondering if it would be possible to get the ConnectionKit framework working for an iPhone app. I know it was developed for the desktop OS, so I'm not sure what sort of dependencies it has and whether or not it could be shoehorned into the iPhone OS.
In my case, I would like to use its FTP functionality, though having access to this entire framework could prove useful for future projects as well.
Any ideas or experience trying this?
In case it helps, here's the official ConnectionKit site: http://opensource.utr-software.com/connection/
The site was a little light on documentation.
The big question is what Cocoa classes it depends on. Since it is doesn't include any UI code, it should be based on Foundation classes. Foundation in Cocoa Touch is similar to, but not exactly the same as on OS X. Just check out what classes it uses.
The other obstacle is building the framework as a static library. Since the iPhone does not support frameworks/dynamic libraries, you have to build a static library to use it in your code.
That should help get you started.
There are two primary issues. One is static library and other is NSHost class that is supported by cocoa - but not cocoa touch. First one is doable - but the second one is doable if and only if you are familiar with Mac OS networking internals.

Going from the iPhone to the Mac?

Note: This is the opposite direction to most similar questions!
I have an iPhone application which I would like to provide a demo of on the Mac. How hard is it to recompile (or rewrite) iPhone applications into Mac applications, assuming I intend to keep the same screen size, and not worry about making my application look "mac-like"?
Is it possible to distribute the iPhone simulator apple provides in the iPhone SDK with a copy of my application? Asking people to go and install it themselves seems like a major requirement.
On the whole most of the "core" frameworks are present on the Mac too. As a rule of thimb, any class starting NS will be present on the desktop - NSString, NSArray and NSObject etc. That hopefully means that all of your engine code will simply recompile and run.
The same is true of some middleware - all of iPhone Quartz will be present - classes and types starting CG... If you use 3D, there is OpenGL on the desktop but it is full OpenGL rather than the iPhone's OpenGL ES. There are some differences but your code will be pretty easy to port.
Where you will definitely need to recode is the UI. Not only because AppKit is not present but because the UI design you need for iPhone will generally not work on the desktop. The iPhone supports multitouch and does not have (meaningful) overlapping windows. Similarly, if you use any of the iPhone's hardware you will have to reimplement - the accelerometer and GPS are obviously not available on the desktop. In both these cases, the rule of thumb is that classes starting UI... are specific to the iPhone.
If you follow Apple's MVC design guidelines when you write your app, if will keep the UI related code well seperated from the engine code and porting should be easier.
First, you can't distribute the iPhone simulator. That's out of the question. The iPhone SDK agreement states:
You agree not to rent, lease, lend, upload to or host on any website or server, sell, redistribute, or sublicense the SDK, in whole or in part, or to enable others to do so.
You might be able to use parts of your program in the Mac version, but you'll probably have to rewrite UI-related code.
If your app is mostly OpenGL or custom views, probably not too hard at all. If your app using lots of UIKit views, then you will need to rewrite quite a bit to use the Mac standard Cocoa views instead. They are quite different.