' + ' - class method
' - ' - instance method
c.f) http://en.wikipedia.org/wiki/Objective-C
'STUDY > Objective-C' 카테고리의 다른 글
objective c // calcurate (0) | 2010.06.30 |
---|---|
[Objective C] NSDictionary , NSMutableDictionary (0) | 2010.06.24 |
[Objective C] method 앞에 plus (+) , minus (-) (0) | 2010.06.24 |
[Objective C] NSArray , NSMutableArray, Enumeration (0) | 2010.06.24 |
[Objective C] NSMutableString (0) | 2010.06.24 |
[Objective C] NSString (0) | 2010.06.24 |
접근 설정 방법 :
* Objective-C 에서도 C++와 같이 상속을 받을때 Overriding이 가능함.
@interface className : NSObject
{
@public
int x;
@protected
int y;
@private
int z;
}
-(int) apple; //method의 접근형은 private로 불가능. 항상 public형
-(int) pear;
-(int) banana;
-@end
* C에서와 같이 Objective-C에서도 Overloading이 불가능함
@interface className : NSObject{}-(int)g: (int)x;-(int) g : (float) x; // ERROR : this method is not different// from the previous one (no label)
-(int) g: (int) x : (int) y; // OK : two anonymous labels-(int) g: (int) x : (float) y; // ERROR: not different from the previous.-(int) g: (int) x andY: (int) y; // OK : second label is “andY”-(int) g: (int) x andY: (float) y; // ERROR : not different from the previous.-(int) g: (int) x andAlsoY: (int) y; // OK : second label is andAlsoY,// different from “andY”@end
shelf & super
- shelf : C++의 this 처럼 object 자기를 나타냄. 하지만 C++와 달리 shelf의 값을 변경할수 있음
- super : 상위 클래스
'STUDY > Objective-C' 카테고리의 다른 글
[MAC] Xcode 자동정렬 Tip (1) | 2010.06.24 |
---|---|
[Objective C] Composition (0) | 2010.06.24 |
[Objective C] 접근자, 제어자, Overloading, Overriding (0) | 2010.06.24 |
Objective C (0) | 2010.06.23 |
objective-c : 객체지향 패러다임 (0) | 2010.06.23 |
[Objective C] ver.Console (0) | 2010.06.23 |