|
|
#1 |
|
Creating Objects on the Fly
Hello All!
First off, I'd like to put it out there. I'm new to OOP. I mostly do web scripting in my spare time (VBScript and JavaScript). However, a friend of mine suggested that I give creating iPod apps a try. So, here it goes... I have a JavaScript page that creates a tracker. For simplification, it takes user input of the Name and Age and sorts it based on Age. To do this, I have a form that allows the user to enter the data and a button to add values to a <div> container (affectionately named "divBody"). Here's a snippet of what the code looks like: PHP Code:
I can figure out the rest of the sorting and such by trial and error. But I don't know how to add the fields while the code is running. I understand that the objects can be programmed in on the code side using the XCode program. However, the users can enter more than expected. OK, for extra credit, here's another question. I'm sure that once I find an answer to the above question that this may fall into line. In the end, I would like to have a "Person" Object that stores the Name and Age passed. Is it possible to make the Object function like the label and text box as described above? Just a thought. Any help is greatly appreciated! Thanks Todd NOTE: I did post this to another forum, but found it was not the right audience. Sorry for the double post. |
|
|
|
0
|
|
|
#2 |
|
Your question basically amounts to "how do I program in Objective-C," which no one is going to be able to teach you on here. There are mountains of resources online that can get you started.
My one suggestion would be to avoid trying to think of the process as translating Javascript into Objective-C. The languages are so entirely different in scope and purpose that you are not going to get anywhere with that approach. Creating an app in Objective-C has nothing to do with HTML. |
|
|
|
0
|
|
|
#3 | ||
|
Quote:
As far as searching online, I lack the words to describe what I am attempting. If you have a better way of stating "create an object at run time in Objective-C" to find a result that will accomplish my goal, I am all ears and will investigate those options. Quote:
That being said, JavaScript is a language that I know and can use code examples to have a visual representation of the concept in question. I have converted VBScript to JavaScript, ASP to PHP, even used JavaScript to port an idea over to Lua. The end result is what matters, the programming is the adventure! If there is no way of doing what I'm attempting through my example, let me know. I'll figure out a different way of doing it (maybe limiting to populate only the amount of pre-placed objects as stated in the original post). I apologize if this comes off as rude. It is not meant to be. I am serious about converting my idea into a final product. My light hearted original post was an attempt to be softer than "here's my problem, what's the solution". I am not looking for the solution. I'm looking to learn the solution. |
|||
|
|
0
|
|
|
#4 | |
|
Quote:
https://sites.google.com/site/unit2iostutorial/model Of course, a model by itself doesn't do a whole lot.
__________________
Battery Status - On the Mac App Store
The only app that'll estimate when your wireless devices will need their batteries changed. Like it on Facebook! |
||
|
|
0
|
|
|
#5 | |
|
Quote:
|
||
|
|
0
|
|
|
#6 |
|
Just as a quick warning: The finished project at the end of the tutorial doesn't actually work. I'm in a class full of business, journalism, and english majors, so despite how professionally the website may appear, it's actually all stuff I wrote on the fly and hardly tested. I'm not sure which part doesn't work, but I suspect it's in the Controller section somewhere.
__________________
Battery Status - On the Mac App Store
The only app that'll estimate when your wireless devices will need their batteries changed. Like it on Facebook! |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 02:02 AM.







Linear Mode
