#import <Foundation/Foundation.h>
@interface Person : NSObject{
@public
char *_name;
}
-(void)setName:(char *)name;
-(void)haha;
@end
@implementation Person
-(void)setName:(char *)name{
_name=name;
}
-(void)haha{
char *_name="sss";
NSLog(@"哈哈..%s",self->_name);
}
@end
就是属性的char *_name 和 对象方法里面的char *_name 是不一样的吗? |
|