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.
Related
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
I know it's not easy. Is there a step-by-step guide for iOS developer to climb the Mac OS learning curve?
Besides, IconFactory is working on the chameleon project. How much effort will be saved comparing to a traditional port?
It's a similar learning curve to learning iOS SDK development, minus the stuff that's the same: tools, cocoa conventions, Foundation objects (NSString NSArray etc), Core Graphics & Core Animation (mostly), and other lower level frameworks that are similar in both. Basically everything in your app that uses UI<something> needs to be rewritten in something similar but different. In many apps that's a big percentage. I myself eagerly await this "cha-me-leon" project (yes, that's a HIMYM reference).
Is there any MacOS virtual machine that can run on PC?
Is there any source to get it?
What is the best way to develop apps for iphone?
Yes all the developer tools are OSX only.
There are lots of iPhone development books out there go check out amazon and find one with some good reviews and that will get you started.
You might not, in the strictest terms, have to get a Mac to develop for iPhone; but it will be extremely helpful. Apple is relatively talented at squashing efforts directed towards Hackintoshes and virtual machines running OS X.
The shortest answer that will give you the least hassle is: Yes you need a Mac.
But, as far as I know there are a few possibilites, that try to reimplement some Cocoa Frameworks (however they might be Mac OS X only and not iPhone): GNUStep is an example.
But I don't think you get something aquivalent to Xcode (the IDE for iPhone development) this way.
And I think there are some OSX86 Virtual Machines (however these seem to be against Apple's EULA and thus seem to be clearly illegal so I won't point you anywhere to get them).
So to conclude - if you want to develop for iPhone: getting a Mac is the easiest way, even though not cheap.
Hope this helps.
The short answer is - yes.
One possibility for learning some of what you need to know before getting a Mac is GNUstep.
However, GNUstep is mainly useful for learning Objective C, especially since it provides many of the classes that the Cocoa toolkit for iPhone does. This can be run on Windows.
It doesn't, however, support some of the key 2.0 language features that are used 'all the time' in any sample code.
What it will allow you to do is design a UI using their UI designer GORM, and use a near-identical message-based system for implementing a UI, and you could theoretically write Objective C classes in GNUstep and then use them on iPhone.
However, to compile an app for iPhone you basically need to have a Mac, because then you can get the key for signing an app, etc. Since you need to get a Mac at some point, there's really little point in going the much harder route of using GNUstep first and learning a more limited implementation, unless you really need to get started before funds are available.
Despite the new SDK terms that can other programming languages, if you're really wanting to start without a Mac, I'd probably be tempted to look at something like Unity, or perhaps even Appcelerator Titanium, and figuring out all the non-platform-specific logic first on whatever platform (Unity has a free version that can be run on Windows, for example).
I'm not that big a fan of xcode, but is is far and a way the best IDE for Objective C development simply because there's almost nothing else out there.
There are, as always, other options. If you do a web app type project, you can implement the website and test a lot of it in a browser. Furthermore, since Android and iPhone browsers are both WebKit based, you can use the free Android SDK to see what pages look like on a comparable mobile device. And since you can use C and C++ classes as well as Objective C (N.B. not for the GUI, since that needs the Objective C extensions for messaging between objects), another option for making a start without a Mac would be to use Eclipse, QT Creator or some other C/C++ IDE to implement non-GUI classes, so long as you make sure you don't use platform-specific libraries.
But the end of the long answer is still that whatever you do, to compile a proper iPhone app you'll be using xcode and associated tools to finally build it and sign it, and so you need a Mac in the end. If you want to create something targetting the iPhone and won't have access to a Mac, then perhaps you're best off looking at creating an iPhone-adapted website using iui or a similar toolkit to give the site a suitable look and feel.
Actually I don't care too much about Mac OS X development. I want to do only iPod Touch and iPhone development. But anyways, I started learning Cocoa and Objective-C. But it seems like there are many differences between Cocoa and Cocoa Touch, so I am wondering if I am actually wasting my time. Should I just jump directly into iPhone topics?
There is lots of overlap, but if your purpose in learning is to do iPhone programming, then by all means learn iPhone programming directly.
As a side-effect, you will be able to pick up Mac application programming more easily if you should ever have such a desire.
I think you could go either Cocoa-Cocoa Touch or Cocoa Touch-Cocoa and still have a good grasp on what it takes to program for either platform. I tried Cocoa development on my Mac a few years ago and was pretty confused. I finally decided to take up iPhone programming, and picked up Beginning iPhone Development: Exploring the iPhone SDK, worked through that book over a few weeks, and I understand things much, much better now. Really, all it takes is a good explanation of Mac programming. I'm fairly confident I could pick up regular Cocoa programming with far less effort now. Had I started with regular Cocoa programming, I'm fairly confident I would have been able to pick up iPhone programming fairly easily. There are differences, but there are a lot of (very cool) similarities between the two platforms.
PS, I highly, highly recommend that book if you're really interested in iPhone development. It was worth every penny.
Normally I would agree with the other answers here: directly learn the topic you're interested in. But in the case of Cocoa/Cocoa Touch, you'd be better off reading Cocoa Programming for Mac OS X, 3rd ed. by Aaron Hillegass. It's just that damn good!
There are similarities but if the goal is iPhone development, you'll be much better off starting to learn on that platform and then stepping up to the Mac. There's a lot more going on both in the UI frameworks, and in terms of what IB can do so you may well get used to some aspect of the system that is not present on the iPhone (or done differently).
The NS foundation classes are much the same but even there are differences.
Also beware that the simulator will compile and run Mac code that will not compile or run on the phone itself, when using the docs always keep them focused on the iPhone SDK section.
One difference between Cocoa Touch and Cocoa is in the area of memory management.
If you happen to be learning Objective-C for the very first time (or possibly any C-based language for the very first time) I would start with Cocoa Touch.
My reasoning is that the iPhone does not support automatic garbage collection, and you may find it easier to learn the (more difficult? certainly less automatic) way first, then as you migrate to OS X development appreciate the shortcuts that the OS X platform gives you.
If you learn Cocoa development on Leopard initially, you may be frustrated at the seemingly more primitive memory management available in the iPhone.
The two are very similar, though.
Bottom line is if you want to learn to program for the iPhone, go ahead and jump to the iPhone. Mac OS X development is not a prerequisite, just a very similar skillset.
I've taught Mac developers and iPhone developers, and my experience is that it's generally best to learn Mac first, particularly because you can get a solid grounding in Cocoa using Cocoa Programming for Mac OS X, which is still the best book on learning the Cocoa patterns around. So far I haven't found a good iPhone book that teaches the key issues you need to know, and that differentiate Cocoa/Touch programming from Java, .NET and other systems. I've written a couple of articles recently that may be helpful as you think about this:
iPhone Course Syllabus
Review of iPhone Developer’s Cookbook
I've went through about the same question as you, though my initial focus was more on Mac development, the iPhone came later. I'm by no means an expert cocoa coder yet, but things are improving rapidly. I find that the things I learned about cocoa on the Mac come in quite handy on the iPhone; picking up iPhone development certainly went a lot quicker than my first steps in cocoa on the Mac...
In practice, I find both skills come in handy. I'm making an iPhone game, but the data set it uses (the actual puzzles) are created using a small cocoa app I've developed for the Mac. Is there a specific reason why you don't want to learn Mac development? You don't need additional development/designing tools for your game?
(screenshot of the mac app: http://www.qixis.com/images/edit16-screenshot.png)
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.