On Jul 15, 2013, at 8:31 PM, Alex Zavatone <[email protected]> wrote: > DownloadOperation.h > @interface DownloadOperation : NSOperation > - (id)initWithURL:(NSURL*)url; > @property (nonatomic, readonly) NSError *error; > > DownloadOperation.m > #import "DownloadOperation.h" > > @interface DownloadOperation () <NSURLConnectionDelegate> > @property (nonatomic, strong) NSURL* url; > @property (nonatomic, strong) NSURLConnection* connection; > @property (nonatomic, strong) NSMutableData *buffer; > @property (nonatomic) long long int expectedContentLength; > @property (nonatomic, readwrite) NSError *error;
That's not 2 properties, that is one being declared twice, once for external users (in the header) and once for internal use by the class. External users are only supposed to read the property, while the class itself of course has to be able to actually store a value in it, so it redeclares it from readonly to readwrite in a class continuation. This is pretty much the only valid way to declare the same property twice, changing anything else on the property will give an error message, but readonly -> readwrite is OK. Cheers, -- Uli Kusterer "The Witnesses of TeachText are everywhere..." http://www.zathras.de _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
