Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: request for member in something not a structure or union
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: request for member in something not a structure or union




On Jun 4, 2008, at 11:41 AM, Ondřej Čada wrote:

By the way, re my previous message...

On Jun 4, 2008, at 6:31 PM, Ondřej Čada wrote:

probably since I have never needed the explicit getter=xyz attribute yet myself


... is there an example of a practically useful usage of the getter attribute? Whatever I can think of are artifical examples, which could be easily (and with benefits to the code readability and length and reliability) re-written without the attribute, i.e., with the accessor named equally as the property.

I suppose there would be a counter-example of code which relies heavily on the getter named differently from the property, namely, to re-write which without the attribute would mean a result less concise, considerably longer, and less reliable. Though, I can't find such an example myself; might someone help?


@interface MyObject: NSObject {
	BOOL valid;
}
@property (getter=isValid) BOOL valid;
@end

One could also have code with "private" (or other "ivar semantic sugar") prefixes on the ivars:

@interface MyObject: NSObject {
	NSArray *myArray;
}
@property (retain, getter = array, setter = setArray:) NSArray *myArray;
@end



Glenn Andreas                      email@hidden
 <http://www.gandreas.com/> wicked fun!
m.o.t.e.s. | minute object twisted environment simulation



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >request for member in something not a structure or union (From: Memo Akten <email@hidden>)
 >Re: request for member in something not a structure or union (From: Jens Ayton <email@hidden>)
 >Re: request for member in something not a structure or union (From: Memo Akten <email@hidden>)
 >Re: request for member in something not a structure or union (From: Jens Ayton <email@hidden>)
 >Re: request for member in something not a structure or union (From: Ondřej Čada <email@hidden>)
 >Re: request for member in something not a structure or union (From: Ondřej Čada <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.