//
Person.h
Manual memory Management
//
Created by admin on 15/8/5.
Copyright (c) 2015 admin. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Car.h"
@interface Person:nsobject
/*
The role of @property parameters
1. Generating declarations for set and get methods
2. Simple implementation of generating set and get methods
3. If you do not manually declare a relative member variable, a member variable that begins with _ is automatically generated
*/
/*
Types of @property parameters
1. Parameters related to the Set method memory management
Retain: Generating set methods that conform to memory management principles (applied to object types)
Assign: Direct assignment (applied to base data type, object type)
Copy
2. Multithreading-related
Nonatomic: Do not generate multithreaded, multithreaded management code (use this can be, more efficient)
Atomic: Generate multi-threaded, multi-threaded management code (this is the default, the development of Mac software more use this, the app is basically not used)
3. Do you want to generate the set and get methods
ReadWrite: Readable writable property, simultaneous generation of set and get methods
ReadOnly: Read-only property, generating only get methods
4. Parameters renamed by Set and Get methods
Setter: Sets the generated Set method name
Getter: Set the generated Get method name
*/
@property (Nonatomic,retain) Car *car;
@property (Nonatomic,retain) NSString *name;
@property (nonatomic,assign) int age;
@property (nonatomic,assign) float weight;
@property (nonatomic,assign,readonly) int idcard;
Changing the Set method name and get method name
@property (Nonatomic,assign,setter=shezhi:,getter=quzhi) BOOL isdied;
@end
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Small white Study Development (IOS) oc_ @property parameters (2015-08-05)