Subscribe ( )

iPhone Programming Tutorials


 

Forum

You must be logged in to post Login Register

Search 

Apparently i can’t code….

User Post

7:28 pm
August 9, 2008


stowns

Noob

posts 4

1

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

2

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

3

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

4

if that doesnt work, either. Just build the app without running it. Then the code highlighting should work

Kind regards. Nico

10:28 am
August 10, 2008


crazyiez

iCoder

posts 30

5

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

6

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

7

did you try building the the app?

Kind regards. Nico

6:09 pm
August 10, 2008


stowns

Noob

posts 4

8

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

9

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

10

thanks crazylez… that is exactly what i was loking for

6:36 pm
August 12, 2008


crazyiez

iCoder

posts 30

11

NP man Enjoy the tutorials i hear they are good

5:23 pm
August 18, 2008


bobcubsfan

iCoder

Los Angeles

posts 54

12

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

13

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

14

I agree with bobcubsfan.  Brandon is doing more than showing, these tutorials are teaching.

6:52 am
September 19, 2008


gingofthesouth

Noob

posts 3

15

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.

Search 

About the iCodeBlog forum

Most Users Ever Online:

44


Currently Online:

4 Guests

Forum Stats:

Groups: 2

Forums: 6

Topics: 419

Posts: 893

Membership:

There are 934 Members

There has been 1 Guest

There are 2 Admins

There is 1 Moderator

Top Posters:

bobcubsfan – 54

crazyiez – 30

Uhu – 17

AdeC – 17

Nick – 15

jitesh61 – 12

Administrators: Brandon (88 Posts), Collin (0 Posts)

Moderators: VertigoSol (26 Posts)



©   

  • Posted by on 6 Aug 2008 in Uncategorized
  •   |  
  •   |  
  •   |  
  • Comments Off

Comments are closed.