|
|
Log In | Not a Member? |
Contact ADC |
| < 前ページ次ページ > |
readonlyプロパティをオーバーライドして、これを書き込み可能にすることができます。たとえば、readonlyプロパティ、valueを持つMyIntegerというクラスを定義できます。
@interface MyInteger : NSObject |
{ |
NSInteger value; |
} |
@property(readonly) NSInteger value; |
@end |
@implementation MyInteger |
@synthesize value; |
@end |
その後、このプロパティを書き込み可能にするように再定義する、サブクラスMyMutableIntegerを実装できます。
@interface MyMutableInteger : Integer |
@property(readwrite) NSInteger value; |
@end |
@implementation MyMutableInteger |
@dynamic value; |
- (void)setValue:(NSInteger)newX |
{ |
value = newX; |
} |
@end |
| < 前ページ次ページ > |
Last updated: 2007-10-31
|
Get information on Apple products.
Visit the Apple Store online or at retail locations. 1-800-MY-APPLE Copyright © 2007 Apple Inc. All rights reserved. | Terms of use | Privacy Notice |