Need help starting a Flash Card application

Discussion in 'iOS Development' started by greglevy, Mar 12, 2009.

  1. greglevy

    greglevy New Member

    Joined:
    Sep 3, 2008
    Messages:
    1
    Likes Received:
    0
    Hi,

    I've read a book on Objective C programming, Beginning iPhone Development(iphone SDK). Downloaded iPhone SDK and watched all of Apple's videos on it's Developer's page.

    I need help guidance on my first application. I would like to make an application that would be like flash cards and have a small quiz.

    I think the way to start is to use something like Apple' sample code of "Sample Drill Down".

    Any suggestions?

    Thanks
    Greg
  2. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    UILabel, thats all I'm saying
  3. centroid

    centroid New Member

    Joined:
    Nov 12, 2007
    Messages:
    405
    Likes Received:
    0
    Device:
    iPad 2 (Black)
    @ above: best hint available

    Your going to want to have a method that shows the answer when you click the label (question) then tap again at the answer to go to the next question.

    Something like is how I would go about it. If you really good with the sdk make it so if you shake it randomizes the stack. :]


    Also if you don't know where to start then please create a simpler app. When I first started learning java i didn't start making a database of names and sort through them (even thought thats easy as hell (i couldn't think of anything that hard atm)) i started with a simple read user input and print it out.

    I think for beginners if you know the code the hardest part is structure/gui/u2hi. Might just be me.
  4. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    Anothere thing you could do have an NSMutableArray, and let them add the words they want for the flash cards, then add them to the NSMutableArray, randomize the way the array shows the words so like
    Code:
    [[NSMutableArray arrayWithObjects:@"first object", @"second object", @"third object", nil] objectAtIndex:(random() %amount of objects in your array)];
    The random bit may have to be changed, you may have to make a count of how many objects the user inputs and use something like [myInteger count]

    Also it specifies an array must end with nil.

    Wow I've just had an idea, flash cards it's easy enough.
  5. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    Simple help. Okay, here's what you'll need to do to have a decent, albeit very featured limited, flash card app/

    1. Use the default "navigation based project" template in Xcode.
    2. Have the table controller included as the root controller in that template scan the contents of ~/Library/YourApp, ignoring subdirectories.
    3. For every directory included in ~/Library/YouApp, create a table cell with the name of that directory as the text on the table cell. Have the table cell use the gray chevron disclosure.
    4. Inside of each directory, there will be a database of flashcards, including questions, answers, and images (if necesary).
    5. When a user taps a table cell, your navigation controller pushes to a new view controller. The view controller will load its data from the correct database.
    6. While the database is loading, superimpose a loading view, so people know what the app is doing. Alternatively, use a UIProgressHUD to display progress in a HUD.
    7. When the database is finished loading, seed a random number generator. Alternatively, do all the loading in a separate thread and prepare the UI/random number genereator in the main thread (best option).
    8. Use the random number generator to randomly choose a card from your database and its answer. Also pull other answers from the databse. Note the correct answer in your app.
    9. Display the card and question in your view.
    10. ^This would be a good time to increment a count of total cards shown.
    11. Create (let's say) four buttons beneath your view. One of the buttons will display the correct answer as its text, the other buttons will display the incorrect answers.
    12. When the correct button is pressed, let the user know and increment a counter of the number of correct answers. When an incorrect answer is given, let the user know.
    13. Display the next card and repeat these last few steps.
    14. When the cards have been cycled through, or the preset number of cards have been shown, give the user the score by dividing your two counts (number correct and total shown cards).
    15. Ask the user if they want to try again. If so, reset your counts and start over. If not, pop the view controller from the top of the stack, so the user is left seeing the list of flash cards available.

Share This Page