What be the best way to create an app with a list of editable items

Discussion in 'iOS Programming' started by fstigre, Nov 20, 2012.

  1. fstigre macrumors regular

    fstigre

    Joined:
    Aug 12, 2008
    #1
    Hi,

    What would be the best approach to create the app will describe next. I’m not looking for code; I just need to know what components you would use, especially for the item list shown in the picture.

    This application is to practice what I have been reading about Objective-C.

    What I want to do is to have two UITextfields, one to enter an amount and the other one to enter a percentage, I will also need a button that when clicked, it will do some calculations based on the numbers entered by the user, than displaying the result on a UILabel which is not a problem I can do this without a problem.

    My issue is with the item list since I want to display the values entered by the user every time the add button is clicked, I also want the user to be able to edit and delete items in the lists, and as they are deleted or added the total should reflect these changes as well and I don’t know what would be the best way to accomplish this.

    An array of UITextfields maybe? Is this how you would do it?

    Any ideas would be greatly appreciated.

    FYI,
    None of this information will be saved in a database or anything like that, it will only be displayed while the application is in use.

    Here is a link to a picture describing what I want:
    https://www.evernote.com/shard/s157/sh/53e950b8-5f14-408a-b76c-19ee3ec946f6/73a8bb7b221a518a298d939ab2040f75

    Thanks a lot.
     
  2. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    Maybe you need to break it down in some easier steps, your sketch looks like a 20 minute job tbh.

    First: Need 1 textfield for the amount & 1 for the percentage, great, good start.
    If you are doing the button, do the calculation from the textfields, that's an harder start, since normal percentage from [amountTextfield.text floatValue] won't be good, you need to get into NSDecimal's etc.
    Next up, you need an UITableView and an array containing objects.
    Best is you make a custom object which inherits from NSObject, call it "CalculationObject", and make it have property's like, Amount, percentage, Total.
    You can create this object each time you press the button mentioned above, save it to the array and loop over it in the UITableView + show it in the cell.
    Seriously doesn't look like rocket science to me ^_-
    Also, the editing is quite easy, this is all build in UITableView in the iPhone SDK :)

    Maybe if you break it down, it will be easier ^_-

    Greets, Noxx
     
  3. fstigre thread starter macrumors regular

    fstigre

    Joined:
    Aug 12, 2008
    #3
    First of all thank you for your reply.

    I know this is something really simple for someone with experience, but as I said this is only to practice not a real application.

    Thanks a lot for the good suggestions, that is definitely opening my mind more. So far at looks like a UITableview is what I will need as well as an custom object.

    This is exactly the type of information I'm looking for.

    Thanks a lot
     
  4. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #4
    What have you been reading (source details, please) that you are attempting to practice? Just curious.
     
  5. fstigre thread starter macrumors regular

    fstigre

    Joined:
    Aug 12, 2008
    #5
    I have been reading the book called Programming iOS 5 and Programming in Objective-C and I feel that if I don't put in practice what I read creating some functinal programs I will never have a good understanding and I wont force myself to work on projects that require challanging tasks, in this case I feel that if I get this done it will open me doors in the programming world.

    Thanks
     
  6. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    Are you doing the exercises at the ends of the chapters?
     
  7. fstigre thread starter macrumors regular

    fstigre

    Joined:
    Aug 12, 2008
    #7
    Some of them, but the only one that has exercises is Programming in Objective-C and I want to start doing more with real iOS programming.

    I'm actually waiting for the Sams Teach Yourself iOS 5 Application Development in 24 Hours (4rd Edition), I know this one has exercises as it teaches the Foundation.

    You don't think this is a good approach to learn? If not, what do you recommend?

    Thanks a lot for your help.
     
  8. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #8
    I would cancel that order immediately, if possible. I have never heard any good things about that book. I would recommend Apress' Beginning iOS 5 Development instead. It doesn't have exercises at the end of each chapter but the quality of this book series overall is much higher than the SAMS one, I believe.

    Oh, I think your approach is good. It might just be a bit ambitious at this point of your learning curve to attempt editable tables. Get comfortable with the fundamentals of iOS development first. Then you can begin to try some self-initiated challenges.
     
  9. fstigre, Nov 21, 2012
    Last edited: Nov 21, 2012

    fstigre thread starter macrumors regular

    fstigre

    Joined:
    Aug 12, 2008
    #9
    That’s good to know but why is this book rated higher at Amazon than the one you are suggesting?

    So, editable tables can be considered a more advanced topic for a beginners?

    Thank you very much for your suggestions, I really appreciate your input, it helps me a lot.
     
  10. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #10
    The list of items that you show in your sketch is a table view. Deleting rows is a standard part of the table view API.

    I recommend that you work your way through the Stanford iOS lectures and do the assignments. It's a college course, free, and many people have used it and recommend it.
     
  11. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #11
    I don't know. Just seems to me that many of those who come to this forum having read the Apress book found it helpful, whereas those who've read the SAMS book often come here with problems.
     
  12. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #12
    I went through SAM's book on Android in about a week, then returned it because it didn't seem like something I'd ever need again. Then again, I just don't like learning from books. I prefer learning from websites, audio/video, and talking with people...

    I highly recommend the Stanford lectures on iTunes U for learning iOS development.
     
  13. fstigre, Nov 21, 2012
    Last edited: Nov 21, 2012

    fstigre thread starter macrumors regular

    fstigre

    Joined:
    Aug 12, 2008
    #13
    Thank you all for your help, I really apreciate your suggestions.

    Aren't the Standford courses a little outdated?
     
  14. fstigre thread starter macrumors regular

    fstigre

    Joined:
    Aug 12, 2008
    #14
    I'm going to answer my own question.

    It is not, originally I was looking at the first course from 2009, but it looks like the latest is from 2011 which covers Xcode 4, storyboards and ARC which I believe are the most noticeable changes.

    I have watched the first two videos and let me tell you, it is awesome, it makes you feel like your are in class. Very well explained, I have a feeling that I will be learning a lot throughout the course.

    Thanks a lot.
     
  15. Duncan C macrumors 6502a

    Duncan C

    Joined:
    Jan 21, 2008
    Location:
    Northern Virginia
    #15
    It's funny how everybody's different. I personally do NOT like learning from videos. I find it annoying to have to wade through a presentation for 45 minutes when some parts crawl an could be covered in a lot less time, and other parts skim over critical details and I have to go back and watch them on slo-mo to try to figure out what the presenter is doing.

    I much prefer books because I can skim some parts and pore over others until I understand them.

    Different strokes for different folks...
     

Share This Page