[BLOG] From Idea To Submission - Fortune Master

Discussion in 'iOS Development' started by SpeedyApocalypse, Jul 12, 2010.

  1. SpeedyApocalypse

    SpeedyApocalypse Member

    Joined:
    Dec 27, 2009
    Messages:
    564
    Likes Received:
    13
    Device:
    4G iPod touch
    BLOG - From Idea To Submission - Fortune Master (Fortune Cookie Application)


    So a few days ago, I had an enjoyable dinner at a fantastic Chinese Food restaurant. At the end of the meal, I received a fortune cookie. After savouring the deliciousness of this cookie, I decided to make a fortune cookie application called Fortune Master. Many others have made fortune cookie applications, but I decided that I should do it right. After recently submitting a new application, and in the limbo of negotiations with another game developer about another release, I decided that I should use the following weeks to develop Fortune Master. I am hoping to post my daily progress along with pictures and thoughts.

    Here are my original goals for the application:

    Code:
    [COLOR="Red"]Incompleted[/COLOR] / [COLOR="Lime"]Completed[/COLOR]
    
    - [COLOR="Red"]Over 10,000 - 15,000 fortunes [/COLOR] - Could not complete.  Would take to long and lack of possible fortunes to think of.  Ended with over 1,000 though.
    - [COLOR="Lime"]Lucky lottery number generator [/COLOR]
    - [COLOR="Lime"]Draggable/removable wrapper on the cookie[/COLOR]
    - [COLOR="Lime"]Breakable cookie[/COLOR]
    - [COLOR="Lime"]Crack Sound Effect[/COLOR]
    - [COLOR="Orange"]Facebook/Twitter/Email submissions of fortunes[/COLOR] - Finished with only email.  Twitter SDK wasn't working out and I couldn't even import the Facebook SDK.
    - [COLOR="Lime"]Fortune cookie recipe[/COLOR]
    - [COLOR="Lime"]Fortune cookie facts[/COLOR]
    - [COLOR="Lime"]Adjust fortune cookie colour[/COLOR]
    Day 1:

    - Mocked up icon
    - Created XCode Project
    - Created Navigation Controller
    - Edited XCode Project to hide statusbar, hide nav controller.
    - Started compiling list of fortunes into .txt file to use as database.


    Day 2:

    - Added to the list of fortunes. Probably going to finish doing this before starting the actual coding. Currently have ~300 fortunes.
    - Mocked up how to display the fortunes. Going to be a UITextView with no editable properties. Some fortunes may be longer than 1 line so I cannot use a UILabel.


    Day 3:

    - Still working on collecting fortunes. Borrrrringggg.
    - Achieved 610 fortunes so far. 9,400 to go!


    Day 4:

    - Currently have 1,000 fortunes, gonna start creating the application now.

    Day 5:

    - Had to go somewhere so I took my laptop to code with.
    - Currently working on the animation.
    - Has the animation framed out using coloured squares.
    - The animation is pretty cool. You can drag the wrapper off of the cookie. When you tap one side of the cookie, it spins off and breaks. When you tap the other side, so you have both sides broken, the fortune paper expands and the fortune fades in. It looks great!
    - Created the reset code so you can have another cookie. A hand even comes in and places the cookie! One problem though, the cookie is all messed up due to the rotation.


    Day 6:

    - Moved the code from the laptop to the main iMac. Going to start fixing the rotation issue and create some graphics. Maybe have the wrapper/cookie done? we shall see.
    - Working on the background for the App - will post later.
    - Below is a picture of the background, for where you crack the fortune cookie. Watermark was added to remove any copying.
    - Has consume soup, 2 chopsticks, a menu, a saying in Traditional Chinese (decode if you want to), and a beautiful wooden table.

    Please Register or Log in to view images




    Day 7:

    - Working on more graphics.
    - Currently finished the Wrapper, Cookie, and the Hand.
    - Implemented the fortune code to select a random fortune. It is working beautifully! No lag at all. Implemented on the viewDidLoad and the Reset so you will view an animation as it is selecting a fortune so you do not experience much waiting time at all.
    - Added crack sound effect. Going to probably add ambient music and some other sounds as well.
    - Improved on the current dragging system with timer. Runs MUCH smoother now.
    - Came up with the idea to customize colours.
    - Experienced a huge build error. Would build on simulator but not device.
    - Fixed huge build error. Cleaned all targets, restarted Mac and iPod, and re-applied code signatures.


    Day 8:

    - Just surpassed 1,000 lines of beautiful code.
    - Added feature to change fortune cookie colour (unique for fortune cookie applications).
    - Fully implemented a pull-out for the cookie colours.
    - Adding another pull-out for the more tab.
    - Compiled a few more fortunes. Going to add a feature where users can add to the master list of fortunes.
    - Finished animation of pull-out menus. It looks beautiful.


    Day 9:

    - Working on the more tab. Experiencing a problem because I added objects outside of the 320x480 border and when I push to a new xib file, it shows the other stuff out of place. I guess I am not going to use the wipe transition and just blink it toward the new xib.
    - Fixed the more tab issue.
    - Made all of the tabs for recipes and facts. Going to work on collecting those tomorrow.
    - Created back buttons and button artwork for the application. May post tomorrow.


    Day 10:

    - Hardcoded the recipe page into a UITextView. It is awesome! Currently going to work on the facts page.
    - After I am finished the facts page, all I have to do is implement the "share" feature and I will be good to go.
    - EDIT: I also have to create the icon.



    Day 11:

    - Working on the icon now.
    - Finished Default.png and the icon.
    - Finished email integration to email fortunes.
    - Couldn't import Facebook SDK into the project (even when linked, it gave 208 errors).
    - Trying to import/use Twitter integration.
    - Twitter integration failed so we are using only email to share in version 1.0.
    - Taking screenshots.
    - Uploading to Apple and going through the submission process.


    Please Register or Log in to view images

    Please Register or Log in to view images

    Please Register or Log in to view images

    Please Register or Log in to view images

    Please Register or Log in to view images

  2. SuperMario

    SuperMario Active Member

    Joined:
    Dec 28, 2009
    Messages:
    1,330
    Likes Received:
    10
    Device:
    iPhone 5S
    Nice! I will most likely download your app.
    Looks like an awesome app.
  3. lauNchD

    lauNchD Well-Known Member

    Joined:
    Jan 27, 2008
    Messages:
    1,844
    Likes Received:
    261
    Device:
    iPhone 5 (Black)
    There's already a Tapulous app that does this, but yours has the potential to be more awesome

    Please Register or Log in to view images

  4. Just_For_Now

    Just_For_Now Active Member

    Joined:
    Mar 21, 2009
    Messages:
    1,898
    Likes Received:
    1
    Device:
    4G iPod touch
    Nice. You could use an array of objects for the fortunes.
  5. lauNchD

    lauNchD Well-Known Member

    Joined:
    Jan 27, 2008
    Messages:
    1,844
    Likes Received:
    261
    Device:
    iPhone 5 (Black)
    The "array of objects" needs to be loaded in somehow. A txt file is fine for that, although a plist, or even a SQLite database (if you have thousands of 'fortunes') would be better. Hard-coding strings into the app is just plain stupid.
    AppStoreMod's crappy "100 Insults" app uses a switch statement and a case for every insult, resulting in over 200 lines of unnecessary, non-localizable hard-coding.
  6. Just_For_Now

    Just_For_Now Active Member

    Joined:
    Mar 21, 2009
    Messages:
    1,898
    Likes Received:
    1
    Device:
    4G iPod touch
    Really? I use array of objects right from code. No need for a file.

    & LOL @ appstoremod.
  7. lauNchD

    lauNchD Well-Known Member

    Joined:
    Jan 27, 2008
    Messages:
    1,844
    Likes Received:
    261
    Device:
    iPhone 5 (Black)
    Well, it depends on what you're trying to do. If you have a large/undefined number of strings it's better to keep that in a resource file and instantiate strings from it whenever necessary.
  8. Axis

    Axis Super Moderator Staff Member

    Joined:
    Dec 2, 2007
    Messages:
    6,288
    Likes Received:
    133
    Device:
    iPhone 4S (White)
    The memory overhead of 10,000 hardcoded strings: 2 bytes per character (Unicode) * 35 (average number of characters per string) * 10,000 = 700k. That's obviously not a good idea.

    In this case, lazy loading from a file is the way to go. Even in much smaller cases, dynamic is better.
  9. SpeedyApocalypse

    SpeedyApocalypse Member

    Joined:
    Dec 27, 2009
    Messages:
    564
    Likes Received:
    13
    Device:
    4G iPod touch
    I recently did this on my application that I submitted yesterday (it had a 3 second search time to a database of over 100k entries.). Anyways, simply load into .txt file, load into an array as string separated by \n and then use arc4random() to get a random line number. This goes from a potential 100k lines of code (to hardcore the strings) into only 6 or 7.
  10. Virtualball

    Virtualball Well-Known Member

    Joined:
    Nov 23, 2007
    Messages:
    1,118
    Likes Received:
    63
    I would make a text file with the number of lines as the first line and then tell the program to copy the next n lines into an array. After that, it would pick a number between 1 thru n randomly and then print it to the screen.

    Please Register or Log in to view images

Share This Page