This is part of an ELC Tech Network

226 Comments

  1. Doug
    Posted March 2, 2009 at 1:10 am | Permalink

    I’m afraid I’m having the same problem as Frank- the tutorial video never mentions connecting the background (court) view to anything, but if I don’t I get a crash error telling me the view outlet was not set. However, if I hook it to the “view” connector, the background court image is the only thing I can see. Any guidance would be appreciated!
    Thank you.

  2. Amit
    Posted March 4, 2009 at 11:14 am | Permalink

    Hey! Thanks for this site, you are the greatest! I am learning loads from your tutorials!

    I have a few questions about C Objective and Xcode

    What is the differennce between .h and .m???

    iTennisViewController.h

    and

    iTennisViewController.m

    and @property(nonatomic,retain)

    what does nonatomic,copy and retain do?

    How do I know which one to use?

    @property(nonatomic,retain)

    or

    @property(nonatomic)

    or

    @property(nonatomic,copy)

    Many Thanks!

    Amit

  3. Nick
    Posted March 20, 2009 at 12:00 am | Permalink

    I’m having the same issue Owen is having. I’ve tried both typing in the code and copying and pasting from the example and neither seems to be working. Is it an issue with dragging over the images to the resources file?

  4. Posted April 6, 2009 at 3:43 pm | Permalink

    You are a God-send! I have purchased several books trying to learn this stuff, but none of them have made sense. Your tutorial is so well laid out and things are incredibly easy to follow! Thank you so much!

  5. Posted April 7, 2009 at 5:00 pm | Permalink

    For those still getting the splash screen flashing briefly and then displaying white before fading to the court image 2 seconds later, check that you are not using Default.png instead of Splash.png. It took me awhile to figure it out since I had skipped the step of downloading the Splash.png image having already seen it in the Default.png image.

  6. iNewbie
    Posted April 20, 2009 at 11:06 am | Permalink

    Hi guys,

    I am so glad to see such a great example of a basic iPhone game. I followed the tutorial carefully, but what I got is a working splash screen followed by a empty court that doesn’t respond to clicks in the simulator. I had a friend tried my code but ended up with exactly the same thing.

    What I have missed?

    Thanks!

  7. iNewbie
    Posted April 21, 2009 at 10:51 am | Permalink

    Anyone can help? The only things stood out to me was the info said the different UIImage (like the paddles and the ball as well as the view (court)) are being clipped.

  8. Francisco
    Posted April 22, 2009 at 12:09 am | Permalink

    I cannot connect the images to the file owner, seems that the only available option is VIEW. A couple of people is having the same problem but I see no anwser in the posts. what are we doing wrong?

  9. iNewBie
    Posted April 22, 2009 at 3:08 pm | Permalink

    I got it. It’s because I didn’t connect something, something the tutor didn’t talk about explicitly…

  10. The Kellen
    Posted April 22, 2009 at 6:07 pm | Permalink

    For those that cannot connect the image to the file owner -

    Before you can connect then, you have to build the project. Do this in XCode by clicking on build in the top menu bar. Choose to save, and then you can connect the image.

  11. Francisco
    Posted April 24, 2009 at 4:08 pm | Permalink

    Great! thats works perfectly.

  12. alex
    Posted April 29, 2009 at 1:48 am | Permalink

    hi, at the start of the coding, where we have to put in
    iboutlet uiimage view *ball;

    the colour of the word ball stays black, it doesnt go the light green colour. whats the problem?

  13. Francisco
    Posted April 29, 2009 at 9:55 am | Permalink

    I dont know were to post this; I want to writte an small program that allows me to pass attendace. I have no idea where to start, seems pretty easy in my mind but I need some pointers of what I will need.

  14. Lee
    Posted May 3, 2009 at 8:27 pm | Permalink

    Hello,

    Here is a very odd thing.

    In the code for ‘viewDidLoad’, I have the following:

    [super viewDidLoad];
    self.gameState = kGameStatePaused;
    ballVelocity = CGPointMake(kBallSpeedX,kBallSpeedY);

    WHen I compile, this last line is throwing the following(vague) error:

    error:syntax error before ‘;’ token.

    I downloaded and ran your source codes with no problems. I even copy and pasted the code from yours to mine, but it caused the same error.

    take care,
    lee

  15. Jonathan
    Posted May 5, 2009 at 6:33 pm | Permalink

    Hey Brandon,

    I’m having the same problem as Alex up there ^^^. When I enter in the required code, the “*ball” part stays black, and so do the rest of the similar parts of code. Why does that happen? This is my first time using Xcode, so i might be making a dumb mistake, but can someone just correct me then?

    - Jonathan

  16. Mario
    Posted May 12, 2009 at 8:10 pm | Permalink

    I just wanted to reiterate how much I appreciate this tutorial. I am starting out programming for the iPhone and this is so much more fun than most dinky starting tutorials!!!

    Thanks!!! You Rock!!!

  17. Wolter
    Posted May 19, 2009 at 3:41 pm | Permalink

    Cool tutorial, but when I try to do what you are doing in the video, it doesn’t work the same way.

    I can drag the Image View onto the iTennis View Controller, and then set the background image no problem.
    If I try to drag over another Image View (for the paddle), it doesn’t show a small outline like in the video; rather it is a big outline the same size as the iphone display. If I drop it in, it replaces the background image, and if I try to resize it, it stays stuck in the middle of the screen (I can’t move it around, and the background behind it is striped gray-white).

  18. rich
    Posted May 21, 2009 at 5:49 am | Permalink

    I have a question about the dealloc method, I thought I read it in some book that since the UIImageViews and UILables were created by the nib, the releases are taken care by the nib, is it wrong?

    Thanks.

  19. mkppk
    Posted May 25, 2009 at 9:58 pm | Permalink

    @Lee
    About your vauge error “error:syntax error before ‘;’ token.”… I bet you have semi colons on your #define lines – you shouldn’t.

    Bad:
    #define someVar 3;

    Good:
    #define somVar 3

  20. Jonathan
    Posted May 29, 2009 at 6:13 am | Permalink

    Thank you for this wonderful tutorial. I’m knew to iPhone / Mac development and this answered most of my basic questions. This is definately the most complete tutorial I’ve seen on game development for the iPhone and you’ve saved me hours (perhaps even days) of thrashing. Thank you so much and please know that I am definately interested in reading / watching more tutorials by you on iPhone development. I would certainly be interested in reading / watching an OpenGL and Quartz tutorial.

  21. Dcybele
    Posted May 31, 2009 at 4:21 pm | Permalink

    WONDERFUL Tutorial, thanks so much Brandon!

    Just a minor note, there’s a typo in:Double click on the file iTennishViewController.xib to open it up inside of Interface Builder.
    This is just before your video.

    I believe it should be iTennisViewController.xib (no h) ;)

    Again, though, thanks SO MUCH! Great work!

  22. Posted June 3, 2009 at 8:01 pm | Permalink

    Great series. I’ll add a snippet about it to our news.

  23. Posted June 15, 2009 at 2:32 pm | Permalink

    Awesome tutorial set! Thank you so much!

    Just one question real quick:

    I was just wondering why you didn’t add the gameState and ballVelocity variables to the dealloc method?

    I’m very new the objective-c programing so I apologize for misused terms and such.

    Thanks again!

  24. Joe
    Posted June 16, 2009 at 1:54 pm | Permalink

    You’re awesome, dude! Great tutorial and thanks a bunch!

  25. Al
    Posted June 24, 2009 at 2:21 pm | Permalink

    This tutorial is amazing! Thanks for posting it!

    Unfortunately, I have a bit of a N00b question: only the court will show up when I try to build and run the program, even when I have all the other UIImageviews on screen and defined. I have checked and rechecked all of the connections for the UIImageViews in both the code and IB, as well as looked over your source code multiple times. I have seen absolutely nothing different between the two, but there is clearly something wrong with mine. Does anyone have any idea of what is going on?

    Thanks in Advance.

  26. Al
    Posted June 29, 2009 at 8:24 pm | Permalink

    Fixed it! Never mind! Excellent tutorial! Can’t wait to try the others!

  27. Al
    Posted June 29, 2009 at 8:24 pm | Permalink

    Fixed it, so never mind! Excellent tutorial, Brandon! Can’t wait to try the others!

    • CJ
      Posted June 24, 2010 at 11:23 am | Permalink

      How? I’m getting the same problem.

  28. Posted July 1, 2009 at 10:21 pm | Permalink

    wow, helped me allot. im looking forward to reading more of these tutorials. keep up the great work man! =)

  29. Graham
    Posted July 2, 2009 at 8:04 am | Permalink

    This is exactly what I was looking for, thanks a lot!

  30. iBots
    Posted July 4, 2009 at 10:27 am | Permalink

    Hmm… I’ve looked over the tutorial and all the replies here but I can’t find the solution to my problem.

    I click on ‘Build and Go’ and I see the iTennis loading screen but then the app crashes with:

    *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’

    …In my code I see a yellow warning at the bottom of my viewDidLoad method, right under the NSTimer: “NSTimer may not respond to ‘+scheduledTimerWithTimeInterval:target:selector:userInfo:repeat:”

    Help?

  31. PLi
    Posted July 12, 2009 at 4:37 pm | Permalink

    Can anybody explain what the fault is when you only see the backgrodun image (the court) and not all other objects? I overlooked it now several times but for some reason I don’t get it ;-)

    Thanks,
    PLI

  32. PLi
    Posted July 12, 2009 at 4:38 pm | Permalink

    Can anybody explain what the fault is when you only see the background image (the court) and not all other objects? I overlooked it now several times but for some reason I don’t get it ;-)

    Thanks,
    PLI

  33. vconrad
    Posted July 13, 2009 at 11:38 pm | Permalink

    Great tutorial, thanks. I’m having the same problem as Taylor though. The splashscreen fades away to a blank white screen and nothing happens. Since I get no errors or warning from the build Im a little stumped. Did anyone manage to fix this?

  34. vconrad
    Posted July 13, 2009 at 11:45 pm | Permalink

    Doh – fixed my white screen problem.

    If anyone else has this problem like Taylor and I, check that you put:

    viewController.view.alpha = 1.0;

    inside the finishedFading method.

  35. Sam
    Posted July 25, 2009 at 2:30 pm | Permalink

    For making the size of the UIImageView small enough to have the ball hitting the correct place you can go Layout->Size To Fit while it’s selected.

  36. Vince
    Posted August 6, 2009 at 1:44 pm | Permalink

    For those with the problem of dragging the uiimageView onto the layout and then not being able to drag any more uiimageviews onto the layout, make sure you’re using the right .xib file. Don’t use mainwindow.xib. Use the itennisViewController.xib.

  37. Vince
    Posted August 7, 2009 at 4:27 am | Permalink

    If you have problems getting your reference outlets to work, MAKE SURE that you followed his code to the LETTER in your .h file. The IBOutlets I had defined in mine were the wrong type. I had created pointers to “UIImage”s instead of pointers to “UIImageView”s. Once I did that I could properly drag my connections over to the file’s owner box and see the iboutlets I needed to. Download his source and copy his .h if you still have problems. Run a file comparison to yours if you have to. His tutorial works.

  38. Vince
    Posted August 7, 2009 at 4:30 am | Permalink

    Oh yeah. And the crashing issue. Mine crashed at first, but then I realized I messed up the original reference outlet of the view connecting to the view.

    Download his source and look at his xib in interface builder to see what I mean. I started with his screencast tutorials. I took those for granted. They really do make it easier to make sure you follow along correctly. Perhaps seeing him type in every letter reinforces to you, the subtle differences in the code lines.

  39. ThinkMud
    Posted August 22, 2009 at 7:01 pm | Permalink

    This is great man, thanks for the tuts and info. I’m a long time windows .net developer, but total n00b to macs and iphones, and i’ve learned tons already by walking through your tutorials.

    I’d suggest anyone that really wants to learn should go through these and manually create everything, and not just download the source. I seem to learn much faster by typing the code.

  40. Gary
    Posted August 25, 2009 at 9:56 pm | Permalink

    Great Job….

    It’s been very detailed, can’t wait to have my Mac to follow to follow your instruction…

  41. Lane
    Posted August 27, 2009 at 6:04 pm | Permalink

    Ummmmmmmmmmm can i do this on a windows vista??

  42. Posted September 2, 2009 at 1:18 am | Permalink

    will u give full game

  43. Posted September 2, 2009 at 1:19 am | Permalink

    good works ben, i like it

  44. Posted September 7, 2009 at 8:12 am | Permalink

    Hello dear, thank you for useful article. It cleared me a lot of things. Love, Granny.

  45. Amy
    Posted September 13, 2009 at 6:19 pm | Permalink

    Hi Brandon,
    Thanks for the great tutorial. I have a quick question:
    how to add speed to this game? Your answer will be
    highly apprecited. Thanks.

    Amy

  46. Amy
    Posted September 13, 2009 at 6:20 pm | Permalink

    Hi Brandon,
    Thanks for the great tutorial. I have a quick question:
    how to add speed to this game? It will be very helpful.
    Thank you.

    Amy

  47. Posted October 5, 2009 at 12:05 pm | Permalink

    Great, totally awesome tutorial! Please, please continue to make more :)

  48. Posted October 7, 2009 at 8:01 am | Permalink

    Excellent blog this icodeblog.com well done and I was really pleased to find : this it’s just what I needed to know.
    It’s taken me literally 3 hours and 48 minutes of searching the web to find icodeblog.com (lol) ;)
    But seriously I am really interested in Bulgaria Property normally and so I shall be very pleased to become a regular visitor

    Thanks

  49. jonk
    Posted October 23, 2009 at 4:18 am | Permalink

    hey brandon,

    im new to this, xcode and interface builder,
    and im already stuck on the connections part, where u explained in ur video, when i try making a new referencing outlet for my two rackets, it only shows ‘view’, instead of all the .png files, any help?

    • Ollie
      Posted December 25, 2010 at 2:56 pm | Permalink

      Hi there..

      When connecting you need to right click when holding down on the icon which connects the item to.

  50. Ami Schreiber
    Posted October 25, 2009 at 11:07 pm | Permalink

    Disregard my last post. I figured it out.

    Nice job!

40 Trackbacks

    Post a Comment

    Your email is never published nor shared. Required fields are marked *

    *
    *

    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">