Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Apr 22, 2011, 08:23 AM   #1
iFaisal
macrumors newbie
 
Join Date: Apr 2011
@property ?


hello everyone ,

what is the different between set/get function and @property/@synthesize ?

is it just syntax code or not ? and what does mean ?
iFaisal is offline   0 Reply With Quote
Old Apr 22, 2011, 09:05 AM   #2
gnasher729
macrumors G5
 
gnasher729's Avatar
 
Join Date: Nov 2005
Quote:
Originally Posted by iFaisal View Post
hello everyone ,

what is the different between set/get function and @property/@synthesize ?

is it just syntax code or not ? and what does mean ?
The Objective-C 2.0 language manual on Apple's web site will answer all these questions. And playing around with styles like you did is _very_ impolite.
gnasher729 is offline   0 Reply With Quote
Old Apr 22, 2011, 02:06 PM   #3
Psilocybin
macrumors 6502a
 
Psilocybin's Avatar
 
Join Date: Jan 2011
Location: Ontario, Canada
Send a message via MSN to Psilocybin
synthsize sets up its own get/set methods
Psilocybin is offline   0 Reply With Quote
Old Apr 22, 2011, 06:20 PM   #4
jiminaus
macrumors 65816
 
Join Date: Dec 2010
Location: Sydney
At first we had to code our own getters and setters. There was no concept of a property in Objective-C 1.0, except by the convention that if a class had a method x and a method setX: then it could have been said to have property x.

Then Apple created Objective-C 2.0 and it introduced the @property and @synthesise directives, as well as the dot notation. And the number of getters and setters we had to write was reduced to near zero. And our getters and setters become correct in the face of concurrency (assuming no nonatomic) which set us up well for the days of multicore CPUs and GCD.

And the people programming in the land of Apple were happy. (Well generally, some have some valid objections to dot notation).

So yeah, it's just syntax. But I'd highly recommend you use it, unless you have strong reasons not to.
jiminaus is offline   0 Reply With Quote
Old Apr 23, 2011, 04:19 PM   #5
iFaisal
Thread Starter
macrumors newbie
 
Join Date: Apr 2011
thank you everyone ... I'm understanding now what is the different .
iFaisal is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
How to create a custom property and identifier? mandude iPhone/iPad Programming 2 Aug 12, 2011 01:37 PM
Property vs. Property+Variable Schnigges iPhone/iPad Programming 2 Jun 27, 2011 05:11 AM
Intellectual Property NickZac Politics, Religion, Social Issues 10 Feb 3, 2011 09:56 PM
Accessing properties of properties luckylefty01 iPhone/iPad Programming 3 Jun 24, 2008 11:33 PM


All times are GMT -5. The time now is 11:07 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC