Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

stingblah

macrumors newbie
Original poster
Feb 28, 2009
7
0
I would like to make a basic game for the ipod touch (like minesweeper--i know it's been done but its just an example). I have the sdk and access to a mac, but haven't looked at the "Getting Started" videos on apple.com yet.

I have good knowledge of Python and some C++ (still learning C++ actually). But I do understand very well the idea of object oriented programming, algorithms, functions, arrays, dictionaries, etc. I also know HTML and CSS. I have no experience with Cocoa/objective C.

I have looked in forums across the internet, and I keep getting mixed answers on what iPhone apps are made in. Some say C++, some say JavaScript, some say Objective C. Currently I'm looking into learning JavaScript. What exactly do I need to know to build an iPhone app?

How long would it take someone of my experience level to make a basic game for the iPhone? I have already made minesweeper in Python, and didn't think it was that hard. Also, is it possible to make a game in say Python and port it to the iPhone? idk if that even makes sense.

Thanks a LOT for any help!!!!
 

Jeremy1026

macrumors 68020
Nov 3, 2007
2,215
1,029
You can't write iPhone apps in Javascript. You can write them in Objective-C. For a simple minesweeper game it would take about 2-3 weeks depending how fancy you'd want for it to be. For someone of your experience level (a.k.a., n Obj-C) it'd probably take 1-2 months to get a hold of the language + another month of coding the app.
 

stingblah

macrumors newbie
Original poster
Feb 28, 2009
7
0
would it be possible to just ignore Obj-C and make the app in C++? And I'm surprised it would take 1 month for the app. I made it in Python in 1 day. Would it not be possible to make Minesweeper in maybe 1 week, then work on the UI for 3-4 weeks?

Also, I don't know what level of experience you have, but how long would it take someone with prior experience making such apps to make Minesweeper from start to finish?
 

jsw

Moderator emeritus
Mar 16, 2004
22,910
44
Andover, MA
Someone with prior experience and no particular concern about the quality of the graphics could easily make a minesweeper iPhone game in a day. The key is the experience. Someone with fluency in Chinese could easily compose a thousand-word paper about their childhood. Someone without it, though, would take months.

You can't just go with C++ because you need to access the GUI, which means Objective-C, which is sort of a Smalltalk C variant with bits of C++ and Java-like ideas thrown in. It's easy enough to learn the syntax, but, like Java, what takes the real time is learning the massive number of things available in the frameworks as well as the nuances. It's easy to modify an existing Objective-C program, but it's a lot harder to write one from scratch.
 

stingblah

macrumors newbie
Original poster
Feb 28, 2009
7
0
I just watched a few of the Getting Started videos, and see what you guys mean. It will definitely take me a while to get used to the environment (and of course Obj C)

Have you seen the reports of a 9-year-old kid making an application called "doodle kids"? I read that he made it in a language called Pascal, and then "ported it" to the iPhone. What exactly does that mean? He remade the program in Obj C/C++?
 

firewood

macrumors G3
Jul 29, 2003
8,141
1,384
Silicon Valley
You can't write iPhone apps in Javascript.

Of course you can.

You put a pretty large Javascript app inside one big UIWebView (Javascript, CSS and HTML) using HTML5 for local storage. You could probably load, initialize and start the UIWebView using less than one page of Obj-C copied from Apple's examples. The only slightly tricky part might be making sure that all the *.js files get copied into the app bundle.

I've written several small personal utility apps for my iPhone doing exactly that.

The Javascript in webkit is no slouch. I benchmarked it almost 10 megaflops, slow by todays standards, but faster than the supercomputers they used to design the Space Shuttle for instance. (But I've also written iPhone apps using, not only C/Obj-C, but even ARM assembly language to get VFP performance for a lot more number crunching performance.)

imho
 

stingblah

macrumors newbie
Original poster
Feb 28, 2009
7
0
so from what I understand

C++ is good.
Some Objective-C knowledge is a must, but I don't necessarily need to have any sort of mastery over the language.
And JavaScript is a viable option to create an app (which I was planning on learning anyways because I may decide to program for Android)

Is it possible also to use python in the coding? like have a calculator app with the calculations powered by python...

Thanks so much for all your help!
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
C++ is good.
No, not really.

Some Objective-C knowledge is a must, but I don't necessarily need to have any sort of mastery over the language
Mastery may not be necessary but it wouldn't hurt. You will want to become very familiar with Objective-C if you want to do anything other than basic apps.

And JavaScript is a viable option to create an app (which I was planning on learning anyways because I may decide to program for Android)
No, JavaScript is not a viable option unless you are just building web-apps that run within Mobile Safari or perhaps a WebView. Not exactly the same thing as a native app.

Is it possible also to use python in the coding?
No, Python is not an option.

Hope that helps.
 

firewood

macrumors G3
Jul 29, 2003
8,141
1,384
Silicon Valley
The iPhone SDK will allow you to mix Objective-C, ANSI C, C++ and ARM assembly language, all in one app. There's even a glue library somewhere that will allow you to make serious app using primarily Javascript.

The UI framework API is almost all in Obj-C though. But a lot of the other APIs are in plain C, not "pure" Obj-C. Some popular games and music apps use Obj-C just to set up an OpenGL view and touch handlers, and from thence do everything in C.
 

jclardy

macrumors 601
Oct 6, 2008
4,233
4,577
C++ is good.
And JavaScript is a viable option to create an app (which I was planning on learning anyways because I may decide to program for Android)

Just so you know, Android's native SDK uses Java, not Javascript.
 

dubhe

macrumors 65816
May 1, 2007
1,304
10
Norwich, UK
I wrote a basic widget to do a simple calculation I do a lot at work, it has about four numbers input, a couple of yes/no selectors and about 10 lines of calculation which results in a single number answer. This took me about six hours to write in javascript (which I had never used before) would it take about the same time to write for the iPhone?
 

I'm a Mac

macrumors 6502
Nov 5, 2007
436
0
Objective-C++? What the heck is that? :confused:

stingblah, you'll be using Objective-C. You can also use some C too, since Objective-C is just a superset of it.

I'm not quite sure, other than that in the getting started videos for the iPhone sdk they say you can mix and match objective c and c++, and files generally end in a .mm extension. Look here for more info: http://en.wikipedia.org/wiki/Objective-C#Objective-C.2B.2B

And I included the picture from the getting started video:
 

Attachments

  • obj++.jpg
    obj++.jpg
    75.4 KB · Views: 59

stingblah

macrumors newbie
Original poster
Feb 28, 2009
7
0
okay...but

what is the actually meat of the app made out of? Couldn't ut be C++? I thought that's what it said in the third Getting Started video...
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
If you wanna try to pursue development in C++, go right ahead. Just realize that pretty much everyone here is using Objective-C and you are going to get the most help and responses to any queries if you use that too. Kind of a "path of least resistance" thing. And a good programmer doesn't eschew another language just because they don't know it. They take it as an opportunity to learn something else.
 

I'm a Mac

macrumors 6502
Nov 5, 2007
436
0
If you wanna try to pursue development in C++, go right ahead. Just realize that pretty much everyone here is using Objective-C and you are going to get the most help and responses to any queries if you use that too. Kind of a "path of least resistance" thing. And a good programmer doesn't eschew another language just because they don't know it. They take it as an opportunity to learn something else.

Agreed. If you want to make well-developed apps, you'll need to learn objective-c. Sure, you can use some of your C++ knowledge to help you out, e.g. use some C++ methods but for the UI, you'll need to know objective-c, and yes the "meat" of the app is objective-c, for example, the main.m is always in objective-c, as are the view controllers.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.