New to iPhone: I have some questions - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: iPhone, iPad & iPod Game Development (/forum-11.html)
+--- Thread: New to iPhone: I have some questions (/thread-2543.html)
New to iPhone: I have some questions - Xavier - Jul 7, 2008 07:42 AM
I'm a mobile game developer (already worked on J2ME and Symbian phones), and now I'm getting started with iPhone.
But I never worked on Apple plateforms, so I'm discovering Cocoa, Xcode, Objective C and all this stuff.
I created a OpenGL-ES project with the iPhone sdk, and I'm trying to add my own sprite class. But I'm meeting some difficulties:
- I can't include my header file in other files (error: no such file or directory), is there a special syntax in ObjC ?
- What does exactly mean the "-" in front of a method declaration ?
- I saw I could use either CoreGraphics or OpenGL-ES for 2D drawing, which method is the fastest ? (I only have the iPhone emulator, not yet the handset).
Thanks in advance for your answers !
New to iPhone: I have some questions - _ibd_ - Jul 7, 2008 08:40 AM
OpenGL ES should be very fast for 2D drawing.
New to iPhone: I have some questions - arekkusu - Jul 7, 2008 09:56 AM
Read all of the Getting Started documentation and the Objective C primer.
New to iPhone: I have some questions - AnotherJake - Jul 7, 2008 10:00 AM
I believe there are some introductory videos too, which are worth checking out for some easy orientation.
New to iPhone: I have some questions - Xavier - Jul 8, 2008 01:14 AM
well I registered at the ADC and I'm studying videos and documentation to get started.
Thanks for your answers.
New to iPhone: I have some questions - Talyn - Jul 8, 2008 10:38 AM
Xavier Wrote:Hello guys,
In case your questions still linger Xavier, and for those of you who are reading this thread in hope of answers:
1. Objective-C and Apple's coding guidelines generally use the #import statement to bring in source files and other packages. Use #import <*package*> for non-project local files, and #import "*file.h*" for source files you have dragged and dropped into your application.
2. Objective-C uses a different kind of syntax for method declaration. A "-" in front of a method indicates that it is an instance method, meaning that an instantiated instance of the class can call that method. A "+" in front of the method means it is a class method, meaning the abstract class is called to perform it. If you have more questions on this, post here.
3. In general, OpenGL ES is MUCH faster for drawing images and animations, but CoreGraphics allows for better and easier abstraction of such graphics into class/object format and also has much better and easier interfacing and interaction with the other Apple provided APIs.
Hope that answered your question. Good luck!
New to iPhone: I have some questions - Xavier - Jul 10, 2008 06:47 AM
Thanks Talyn for the infos.
I'm now trying to write some data in a file, but it doesn't work yet.
Quote:- (BOOL)writeToFile:(NSData *)data:(NSString *)fileName:(NSString *)extension
My method returns a YES, but nothing is written in the file.
Did you already tried the NSData : writeToFile method ?
New to iPhone: I have some questions - OneSadCookie - Jul 10, 2008 01:45 PM
I don't know how it works on the iPhone, but on the Mac you should not assume you have permission to write to your application bundle.
New to iPhone: I have some questions - Duane - Jul 10, 2008 02:37 PM
On an entirely unrelated note, is it possible to turn off smilies inside code tags on a forum-wide basis?
Also, writing to your application bundle is a bad idea. On Macs, the app might reside in /Applications, but the user might not be a superuser and therefore would not have write privileges (unless they were expressely enabled). The iphone is probably different, seeing as you're running effectively as root (from what I gather), but access is NOT GUARANTEED. The best way to do it is to either use Apple's built-in preferences or write your own files to ~/Library/Application\ Support/YOUR_APP_HERE (again, not sure if it's done this way on the iphone.)
New to iPhone: I have some questions - Talyn - Jul 10, 2008 03:39 PM
New to iPhone: I have some questions - AnotherJake - Jul 10, 2008 04:21 PM
Can't help you on iPhone audio because of NDA, sorry. Maybe tomorrow. Post a thread on it when we get out of NDA.
In the meantime, on the Mac, I would suggest using OpenAL for short sounds like explosions and laser/gunfire, etc. For background music you can use Audio Queues on Mac OS X 10.5 or greater.
If you are talking about trying to understand using Audio Queues on Mac OS X 10.5 (I am NOT talking about iPhone, because it cannot be discussed as to whether or not it even has Audio Queues) then yes, it is convoluted and difficult to approach -- *especially* the example code.
New to iPhone: I have some questions - sealfin - Jul 11, 2008 07:28 AM
Thread split as requested: Audio Queues.