1. 属性默认的属性为public 访问时可以使用.操作符
2. 成员变量默认属性为 protected 访问时使用->操作符
3. 在.h文件中声明方法,在.m中实现方法默认为 public
4. 只在.m文件中实现方法而没有进行声明,该方法默认为 private
@interface testClass : NSObject
{
NSString *strTest; //protected
}
//@property (nonatomic, strong) NSString *strTest;
-(void) func1; //public
@implementation testClass
//@synthesize strTest;
-(void) func1
{
NSLog(@"func1");
}
-(void) func2 //private
{
NSLog(@"func2");
}
@end