tags:

views:

62

answers:

2

can someone please explain why you do @synthesize and @property things on xcode? like, in really simple terms. im so new to this, and dont really get it.

cheers

Sam

+1  A: 
Henrik P. Hessel
yea, but my application runs fine without it. so, why are they needed?
Sam Jarman
They're not *needed* they're just useful for saving time and avoiding mistakes.
Tom Duckering
+1  A: 

Properties and synthesized accessors are new features in Objective-C 2.0.

When you declare a @property you declare somewhat an instance var. Then you @synthesize accessor methods (i.e. getter and setter) for that property.

There are also @dynamic accessors if you're interested.

You should really do your homework on this. Apple has nifty pdf for that.

Eimantas
can you link me to the pdf please?
Sam Jarman
I googled that for you: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/ObjC.pdf
Eimantas
cheers Eimantas
Sam Jarman