iPhone to Mac Development - iphone

I am an iPhone developer and know that framework well. With the Mac App store on the verge, I'l like to learn more about Mac development. Are there any good guides/tutorial/etc. to help with the transition? I have looked around and not found much. Thanks for the help!

You basically need to learn the difference between UIKit and AppKit. (Foundation and Core Foundation are the same on both platforms.) They are subtly different; there are more frameworks which comes with the OS X than with the iOS; a framework with the same name might have more functionality on OS X, etc.
But that's basically it, if you distribute the app through the Mac App Store, because you don't have to learn how to package things by yourself.
The best book on Cocoa programming for Mac is this, but it might be too elementary for an experienced iOS programmer. But it's still a good book.
I guess we'll see a flood of books for people like you, showing the way of Mac development to competent iPhone programmers; but it hasn't happened yet. Maybe you might write one, from your own experience :)

Going the other way, I found that the skills that transfer are really just the low level stuff like Objective-C, Foundation and Core Foundation and the tools are the same.
Also a lot of the low level concepts are the same. There are still targets and action, IBOutlets and IBActions. However on a higher level things are very different. There is, for instance, a table view but you tend to use it in a different way and only when an actual table is required rather than as a framework for a whole GUI idiom. Also, table views have more than one column.
There are many advantages, for example you have much more freedom in how your UI will look. And you use garbage collection. With GC everything you've learned about Cocoa memory management becomes instantly redundant. It's very liberating.

Related

How to get better at UIKit/Core Animation with no design experience?

I've read through Aaron Hillegass's iPhone Programming: The Big Nerd Ranch Guide and I feel I have a solid understanding on the fundamental design patterns/APIs of UIKit. After searching on both here and on Google, it seems that to take the 'next step,' I should practice by writing apps. But: I have no design experience, and I feel that unless I'm doing some work that involves custom controls or any sort of other custom elements, re-writing apps with the same standard controls isn't helping me get better at iPhone dev. So, here are my options:
1) Learn design
2) Find a designer who has some app ideas (note that this is just in my spare time, and I'm not yet looking to make it my full time job, so finding a designer who would just give me free controls/designs would probably be hard)
3) ???
Anybody have other ideas?
TL;DR: I want to get better at iPhone dev by writing more apps for practice, but I'm not good at visual design.
EDIT: To be clear, I am not trying to make these apps with the intention of releasing for the App Store. I am writing these apps to practice iPhone dev and to get better at it.
I'd personally start looking at what other apps are creating as far as custom controls go. Trying to reverse engineer, so to speak, what they are doing will give you insight into what some of the lesser known APIs like CALayer can do for you as far effects, animations, etc. Getting comfortable outside the standard set of controls and APIs will give you the skill set you need so when someone comes to you with a design idea, you can easily translate that into reality. For the next version of my own app I did just this, really digging into cool things you can do.
This blog does just this. His posts come at an angle from how to do custom things that both Apple and third party devs do:
iDevRecipes
Also, here's a reference to really get a sense of some of the cool Core Animation APIs. This guy includes videos demonstrating the effects, as well as Xcode projects:
Subtle Effects With CALayer
Complex Interpolation With CAShapeLayer
3D Objects in Objective-C with CATransformLayer
Combining those with blocks based animations introduced in iOS 4.x can produce some real eye popping and easy to program creations.
I'd suggest, you just start to create some apps. Skill comes with practice.
You will surely have ideas for some apps. Just start with a simple idea.
Even if you are just using the standard UIKit classes you will learn something new. It's easy to think you have understood everything you just read, but in practice you will be facing some little problems you wouldn't even know exist, before.
Also, you can create some good-looking apps, using just the standard UIKit classes, even if you don't have a design background. Interface Builder helps a lot to stick to the iOS Human Interface Guidelines (which you should read).

How hard is iPhone/iPad development

I've been developing for quite a while but while I consider myself competent (or better) with C++, Java, C# & AS3/Flex in areas from web-servers to desktop applications to 3D games, I'm aware all these languages are pretty similar; even on the libraries side I know what to look for based on using libraries that do similar things in another language.
But Objective C I understand to be a different kettle of fish, and developing for mobile devices has always struck me as likely to be hard work since you have to develop on your PC and test on the actual device itself - my experience developing for PS2 put me off such things due to poor debuggers and other tools.
What's the reality? Is it a paradigm shift to move from web-servers and desktop apps and rich web-clients to iPhone... or for an experienced developer is it just another language to learn and new libraries to play with? Is there anything to be scared about at all?
edit: My main question on Obj-C specifically was if it's a different way of programming, like it would be moving to Haskell from Java for instance. It sounds this is not the case.
For starters, ObjC is fairly easy to grasp so long as you focus on the fundamentals. Don't worry about the syntax, there's not much there above C which I will presume you already are familiar with. There are excellent books out there this book is the definitive guide I recommend to most new users, Erica Sadun also has a good book on iPhone development, I recommend both of these highly.
Secondly, the tools aren't hard to use, and you will be pleasantly surprised with the debugger and other tool integration. Instruments was a long time coming, but it's indispensable for catching things like memory leaks, cpu time usage, and now power consumption.
But really, nothing to be scared about, and as for another platform to learn; well, yes and no. There is always going to be another thing to learn, regardless of iPhone or something else. Don't resist. :)
There's definitely a "paradigm shift" (ugh, buzzwords):
You don't have all the memory in the world (and there's no swap either)
You don't have all the CPU time in the world
You probably don't want a binary bigger than about 20 MB (the size that can be downloaded over the cell network)
You can't just change the server backend to make things right.
Graphic design is important if you want to be successful (but you don't want to bloat your app)
Web requests take a while (a website with redirects feels really slow compared to the desktop beside it).
JavaScript animations are painfully slow (ever tried the Google Maps website on an iPhone?)
UI design is heavily constrained by the size of the user's finger (even though the iPhone 4 has a comparatively huge screen).
UI design is really tedious.
The user can do more things than clicking and typing.
I find that the biggest difference is in the UI, not in the language. Languages are easy. Libraries require a little reading/searching/asking around, but then they're easy. UI design and UI programming are very difficult to do well.
Objective C is different but not far removed from normal OO methods. The syntax was the larger barrier for me.
The problem I saw was/is you learn ObjC for iPhone, and you can't take the skill (ObjC knowledge) outside the Applesphere really. I haven't seen a use for it. I have a handful of books I went through to get my feet wet. Some of these, the Apress books, contained errors in the code walkthroughs causing me to Google the book errata countless times.. so be careful of that, if you learn that way.
Also, unless this has changed, you can only develop under OSX with the SDK tools because no Windows version exists to my knowledge.
With that, you also have to play by Apples development rules to get published into the AppStore, which has had its share of dev horror stories.
That said, a working app is fun and beautiful in the end.
On a scale of 1 to 10, it's about a 6.
Apple does use Objective C and it is different then normal C. So Iphone and IPad development can be hard if you've never used Objective-C before. If you are familiar at all with a language called SmallTalk, then Objective-C will be very easy for you to pick up.
Now other mobile devices, such as Android, uses Java. If you are competent in Java then Android development may be easier for you.
Some devices use Windows Mobile. If you are a .NET programmer, you can use .NET compact framework to develop Windows Mobile Apps.
Just so you know too, most mobile SDKs come with an emulator to test your app on. So if you don't have an iPhone, for example, you can still test your app with the emulator. I understand that the emulator is supposed to be 99% as accurate as an actual device
I don't think there's anything to be scared of.
The simulator's pretty alright, even if it can't handle some things - it's hard to simulate the accelerometer, for instance!
Once you're over the hurdle of figuring out what certs you need and setting up the iPhone development account and such, it's fine.
It's a bit of a pain writing something, loading it on the device, trying it out, etc., but the fact that you can actually debug the code running on the device makes it rather a lot nicer than it could be. (I had to maintain an application for the Nokia 9110, and there I had to edit, compile, load, run, crash blindly, stare at code, guess, edit, compile, etc.)
As a long time Windows C++ / .NET developer, I didn't find it very difficult to begin developing in Objective C.
There are some syntax differences that take some getting used to, but in general it similar enough to C/C++ to not feel like a completely new language.
Learning the library code and what you can and can't do easily seems like the larger challenge to me, which is going to be a challenge with any new platform.
I am writing a beginner book called Hello! iPhone, and I've made a mailing list of beginner tips to help people get started. After a week or so of tips, you'll be much more equipped to check out other books and understand the basics a bit better to judge.
http://loufranco.com/beginner-iphone-programming-tips/
It will take you through Hello, World and some other simple stuff (Outlets and Actions, basic memory management, etc).

Software development methodology when doing Iphone development

What kind of practices do you do when developing iPhone apps? For instance, do you write up a technical design document of any sort. Do you write down the design of your app at all? Do you implement a certain methodology agile/scrum/waterfall etc...? I'm just curious when working on projects like an iPhone app, what kind of best practices do people use or do people just go at it?
I've worked on a few iPhone apps, and I've found this workflow works pretty well:
Figure out what the app is going to do. Create a one sentence description of the app that embodies what you're trying to do. If you can't explain the core functionality in one sentence, people won't get it!
Create interface mockups for each screen of the app on paper, and then in Adobe Fireworks. Fireworks' native file format is PNG, so it's easy to create images for use in the actual app later.
Figure out how you're going to architect your app using Model-View-Controller and the other iPhone app design patterns (delegates, dataSources, etc...). Don't try to do something other than MVC. The whole SDK is built around MVC!
Start coding! I usually start with the bare functionality first. For a drawing app, I implement the drawing controller and the important drawing views (color picker, etc..) first. I back things up to an offsite SVN repository as I go using Versions (I haven't had much luck with the repository support in Xcode)
Distribute a beta version of the app to a group of AdHoc testers. This helps a lot. Getting the app in the hands of a few extra people really helps isolate usability issues and bugs that are hard for a single developer to find.
Repeat until satisfied and Apple approves :-)
I haven't done much with iPhone development, but its irrelevant. I wouldn't consider it any different from any other developmental process.
The process is different for each case, some have at it and others follow their development methodologies.
As one who is about to dabble in his first iPhone app, I don't think there is any one methodology that rules over any other. You can apply any of the techniques you mention to an iPhone app, just like any other development effort.
A key thing about iPhone apps, or any Apple related development effort, is that Apple sort of forces you to follow certain design guidelines. That is good in some ways (less to concern yourself with) and bad in others (restrictive).
Also, Objective-C and Cocoa Touch can also lend itself to certain ways of programming.
Now, specifically for me, as a sole developer, I will probably:
Jot down high level features of what I want to be included in the first version
Do an interface mockup (either on paper or with a software tool)
Jot down some key objects and functions (psuedo-code)
Set up a source control mechanism (I think this is key)
Start going at it
Possible repeat of any or all of 1-3 :-)
I prefer to start with small proof-of-principle projects to test out different capabilities of the device that I need for my final product. This is especially important on a mobile device like the iPhone, because hardware limits on memory, processing power, graphics, or display size can render some ideas impractical. It's best to know that your application won't work as you imagined after only a couple of days of playing around, rather than after a month of development.
John Geleynse and others at Apple advocate starting your design with a single sentence that describes your product and its intended audience, and building everything around that mission statement. I've found that this works extremely well for determining what features to incorporate or leave out of a product, particularly on the iPhone. Having a simple core product description at the center of your design is also extremely helpful when you need to explain this product to others in your later marketing efforts.
Aside from that, I've found that iterative development incorporating lots of testing and user feedback has worked for me on every platform I've developed for.

Quickest way to get started with OS X app development?

I need to build an application which will run on OS X, polling for data, and displaying that data full-screen in a purty, graphical way - generally "identifier: value" text in some sort of tabular format, but possibly with spark-lines to display historical changes, and "animations" (nothing fancy, just fading text and similar) to show updates.
However, I've no idea where to get started. I've no experience with desktop application development or development on a mac.
Where/at what should I be looking for OS X development information which will get me quickly up-to-speed (coming from a web-dev background)?
For OS X development, and a really nice overview that will get you writing actual applications quickly, I'm not sure anything can match Aaron Hillegass' book, Cocoa Programming for Mac OS X.
It's considered by many to be the Bible of Cocoa programming, and it is example driven. You are writing applications that you can actually run throughout.
It is useful, although not as much so, for iPhone development, which you don't mention in your question, but you do in your tags.
If you really want to go native with OS X that will mostly mean learning Objective-C and Cocoa. You get started by becoming an Apple Developer Connection (ADC) member and downloading XCode. Inside the ADC site there is a lot of information that will help you get started, Objective C reference, sample code, etc. .
Depending on your background you might want to consider using Adobe Air for your application, if you know Flex or Flash that might be easier for you to learn.
There are also a couple of question already up on stackoverflow on this subject https://stackoverflow.com/search?q=learn+cocoa
Take a look at http://www.realsoftware.com. It's a cross platform development environment. Easy to learn, established user community, lot's of sample, shared code to get you started.

Is it feasible to make iPhone apps using just OpenGL and not Cocoa Touch?

I'd much rather code an app using pure C api such as OpenGL, rather that Cocoa Touch. So I'm wondering: is it feasible? Will I be able to maintain the same user experience that you get with Interface Builder?
None of the UI components have OpenGL equivalents. Is it possible? Yes. Is it sensible? No - you would be much better off learning how to use IB and the UIView classes. Coding the UI in OpenGL would be like painting your house with an artist's brush, using hand-made paint instead of Dulux.
Unless you are working on a game, users will expect your user interface widgets to work the same way they do in other applications. You can never emulate that properly, especially if apple decides to fix certain issues in future firmware upgrades, etc...
You will also need Cocoa for integrating with the system in general to store data, prefs and so forth. Is there any specific reason for your reluctance to use Cocoa? If it's because you feel an aversion to learning objective-c, then you really ought to give it a proper chance. It's a great language for building ui apps. If you are trying to port an existing app, then I would suggest building a wrapper that will interact properly with the iphone and call your c code from there.
This is not a fruitful answer (for that, see AirSource's) and rather a comment on your answer about not using Objective-C, but I learned Objective-C a few months after C# and I find I work well in both. Give it a chance and it will surprise you. There's a learning curve and they are different, but the interface tools in particular are so far ahead that you'll probably find it worth your while. It will definitely be better for you and for your app's users than hand-rolling it in OpenGL.
Depends on your app. Mine's an "immersive" game, so I'm using openGL
instead of CocoaTouch,
with a sprinkling of Core Graphics/UIKit calls to generate nice textures.
If I had to display any kind of standard, non-trivial widget, I'd use CocoaTouch.