Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

fstigre

macrumors regular
Original poster
Aug 12, 2008
158
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.
 

jnoxx

macrumors 65816
Dec 29, 2010
1,343
0
Aartselaar // Antwerp // Belgium
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
 

fstigre

macrumors regular
Original poster
Aug 12, 2008
158
1
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
 

fstigre

macrumors regular
Original poster
Aug 12, 2008
158
1
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
 

fstigre

macrumors regular
Original poster
Aug 12, 2008
158
1
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.
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
I'm actually waiting for the Sams Teach Yourself iOS 5 Application Development in 24 Hours (4rd Edition)...
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.

You don't think this is a good approach to learn? If not, what do you recommend?
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.
 

fstigre

macrumors regular
Original poster
Aug 12, 2008
158
1
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.

That’s good to know but why is this book rated higher at Amazon than the one you are suggesting?

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.

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.
 
Last edited:

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
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.
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
That’s good to know but why is this book rated higher at Amazon than the one you are suggesting?

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.
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,558
6,058
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.

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.
 

fstigre

macrumors regular
Original poster
Aug 12, 2008
158
1
Thank you all for your help, I really apreciate your suggestions.

Aren't the Standford courses a little outdated?
 
Last edited:

fstigre

macrumors regular
Original poster
Aug 12, 2008
158
1
Thank you all for your help, I really apreciate your suggestions.

Aren't the Standford courses a little outdated?

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.
 

Duncan C

macrumors 6502a
Jan 21, 2008
853
0
Northern Virginia
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.

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...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.