The difference between @synthesize and @dynamic

高洛峰
Release: 2016-12-13 09:19:53
Original
1306 people have browsed it

After declaring the property attribute, there are 2 implementation options

@synthesize

During the compiler, let the compiler automatically generate getter/setter methods.

When there is a custom storage or retrieval method, the customization will block the automatic generation of the method

@dynamic

Tell the compiler not to automatically generate getter/setter methods to avoid warnings during compilation

Then by Implement your own access methods

or access methods to dynamically create bindings at runtime: Mainly used when CoreData implements NSManagedObject subclasses, and the Core Data framework dynamically generates subclass attributes when the program is running


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template