There are lots of grocery store apps in the app store, but that’s the problem; there’s too many to really look through, and most of them seem to be way too complicated, with built-in lists of possibly groceries or what have you. I didn’t even need all the bells and whistles of the Palm to-do program when I used that for groceries. All I really wanted was this:
- Let me type new items into the list.
- Let me see what’s currently in the list, scrolling up and down as necessary.
- Let me delete something from the list easily, but not so easily that I’ll do it by accident.
- And remember the list for me while I’m doing something else.
It wasn’t too hard to put all of this together with NS Basic app studio, though there were a few tricky gotchas – like how you have to tell it to redraw the list every time you add something new, just so it can work out the scrolling logic for the new list length.
The most interesting part of it was probably the save and restore logic, to make sure that the list would always be there when I switched away from the app. It seems that Safari doesn’t give a good way of event trapping when you hit the home button on the iphone, so the best way is to resave with every change. Here’s some of the code that handles that.