User |
Post |
7:28 pm
August 9, 2008
|
stowns
Noob
|
|
|
|
|
posts 4
|
|
|
So i am following the latest tutorial on populating using an Array. I've followed it quite closely and have run into a problem. My question is, is there a specific order that code must be written? As in, I have written the code just as it is displayed in the tutorial but for some reason “name” and “description” in the following code will not turn green (sorry for not using the technical terms i'm new). But this has happened a few times when defining different things and i don't see an error in my code.
@interface Fruit : NSObject {
NSString *name;
NSString *description;
}
In fact, i copied and pasted the code from the source file provided and it still doesn't change “name” and “description” to green. I didn't realize that i had a problem until i got to the point where i needed to connect the UITextView to the fruitDescription outlet in IB and it wasnt there to connect to! Here is a screenshot example of my code, side by side with the code from the source file….
any explanations would be extremley helpful!
|
|
9:34 pm
August 9, 2008
|
Admin
|
|
brandontreb
|
|
|
posts 88
|
|
|
One thing based on your screenshot, none of your files appear to be saved. Are you still having this problem after you save the files?
Another thing, do you have the latest version of the SDK?
Let me know if any of these fix it otherwise we can try some more stuff.
|
If debugging is the process of removing bugs, then programming must be the process of putting them in.
-Edsger Dijkstra
|
|
11:24 pm
August 9, 2008
|
crazyiez
iCoder
|
|
|
|
|
posts 30
|
|
|
Yeah Xcode is funny like that. After you make changes be sure to apple + s, otherwise the code wont change color and your newly added variables wont appear in code sense.
Save happy, Save often
|
|
1:06 am
August 10, 2008
|
Uhu
iCoder
|
|
|
|
|
posts 17
|
|
|
if that doesnt work, either. Just build the app without running it. Then the code highlighting should work
|
|
|
10:28 am
August 10, 2008
|
crazyiez
iCoder
|
|
|
|
|
posts 30
|
|
|
Uhu said:
if that doesnt work, either. Just build the app without running it. Then the code highlighting should work
building also saves though
|
|
12:43 pm
August 10, 2008
|
stowns
Noob
|
|
|
|
|
posts 4
|
|
|
I went ahead and saved but none of the variables highlighted….it still looks like the original screenshot i posted. Strangely though, i now have “fruitDescription” as an outlet in the “fruit view controller connections” panel in IB. So obviously something changed. I'm running 3.1 btw.
|
|
12:55 pm
August 10, 2008
|
Uhu
iCoder
|
|
|
|
|
posts 17
|
|
|
did you try building the the app?
|
|
|
6:09 pm
August 10, 2008
|
stowns
Noob
|
|
|
|
|
posts 4
|
|
|
yes i built the program…it didnt change any of the highlights but did work in the end.
Does anyone in here have a link to a great Object-C overview for n00bs. I've probably found most of them but i still manage to have trouble at fully understanding the syntax. what did you guys read when you first started out?
|
|
6:14 pm
August 10, 2008
|
crazyiez
iCoder
|
|
|
|
|
posts 30
|
|
|
Well heres something that i was reccomended to read but i prefer books but you might find this valuable
and check out this thread too… http://icodeblog.com/forum/general/some-hints-and-thanks/page-1
|
|
10:20 pm
August 10, 2008
|
stowns
Noob
|
|
|
|
|
posts 4
|
|
|
thanks crazylez… that is exactly what i was loking for
|
|
6:36 pm
August 12, 2008
|
crazyiez
iCoder
|
|
|
|
|
posts 30
|
|
|
NP man Enjoy the tutorials i hear they are good
|
|
5:23 pm
August 18, 2008
|
bobcubsfan
iCoder
|
|
Los Angeles
|
|
|
posts 54
|
|
|
Here is my Tip of the hat, Wag of my finger (see Stephen Colbert).
Tip of the hat:
Brandon's tutorials are insanely great. Why? Because, having been a teacher for a number of years, I know that just knowing how to do something is nothing if you can't explain it!
Wag of my finger:
At the risk of sounding like an old man (okay I am 66) coding for the iPhone is so complicated and arcane compared to BASIC, Visual Basic, Visual FoxPro or PHP, that it borders on the absurd.
Example:
Declaring a public variable:
Public x = 10;
x is now an integer that can be used anywhere.
For the phone:
NSInteger *x;
@ Synthesize x:
IBOutlet blah, blah, (in at least two places)
@Property (nonatamic, retain) NSInteger *x; What is this, radioactive?????
and then it still yields an error because it is NOT GLOBAL!
Seriously, thanks, Brandon, for your hard work. I am looking forward to SQL because there is NO tutorial from Apple. Sample code is mostly worthless without an explanation. What is Dehydrate?????
|
|
12:08 pm
August 19, 2008
|
Admin
|
|
brandontreb
|
|
|
posts 88
|
|
|
bob,
Thanks for your kind words man. That means a lot. I have completed the first part of the SQL tutorial and it is now up. A quick note on the hydrate/dehydrate stuff in the SQLBooks example. These methods are actually pretty straight forward but appear confusing as apple has given the stupid names.
Basically, hydrate gets called when a Book object gets selected. They do this so they don't have to load every bit of information about a book when the app first launches. The only information retrieved when the app loads is the primary keys and the book titles. At this point a book object is considered “dehydrated” meaning it doesn't have all of it's information. So when the book is selected, hydrate is called which populates things like author, description, etc…
Dehydrate performs just the opposite releasing all of this book data. I will be addressing this more in coming tutorials as this design is quite clever.
I hope that helps.
|
If debugging is the process of removing bugs, then programming must be the process of putting them in.
-Edsger Dijkstra
|
|
11:14 am
August 21, 2008
|
Strangeite
Noob
|
|
|
|
|
posts 5
|
|
|
I agree with bobcubsfan. Brandon is doing more than showing, these tutorials are teaching.
|
|
6:52 am
September 19, 2008
|
gingofthesouth
Noob
|
|
|
|
|
posts 3
|
|
|
Strangeite said:
I agree with bobcubsfan. Brandon is doing more than showing, these tutorials are teaching.
Ahh yes, and not only is he teaching but he is breaking the NDA that he agreed to, ot get his hands on the SDK. Now that said I think the NDA still being in effect is absurd and I commend him for educating the world anyway!
Good work.
|
|