`
hqman
  • 浏览: 352644 次
  • 性别: Icon_minigender_1
  • 来自: 苏州
社区版块
存档分类
最新评论

objective-c properties

阅读更多

学了一段时间 objective-c properties 概念一直比较疑惑。

 

@property (
<parameters>)
 <type> <name>;

类似 java 中 get set 方法,

parameters: copy retain assign nonatomic readonly

逐个剖析一下

assign: 对基础数据类型 (NSInteger,CGFloat)和C数据类型(int, float, double, char, 等等)
应该没有引用指针的概念 相当于 =。

copy:  对NSString  相当于是clone 一个对象。

retain: 对其他NSObject和其子类  地址引用。

nonatomic
: 禁止多线程 变量保护,提高性能。

readonly

: 告诉 @synthesize 不需要生成 mutator 方法



分享到:
评论

相关推荐

    Objective-C Programming: The Big Nerd Ranch Guide (2nd Edition)

    Objective-C Programming: The Big Nerd Ranch Guide (2nd Edition).epub (epub 格式) Want to write iOS apps or desktop Mac applications? This introduction to programming and the Objective-C language is ...

    iOS 7 Programming Fundamentals: Objective-C, Xcode, and Cocoa Basics

    iOS 7 Programming Fundamentals: Objective-C, Xcode, and Cocoa Basics by Matt Neuburg (Author) Publisher: O’Reilly Media (October 2013) Language: English ISBN-10: 1491945575 ISBN-13: 978-...

    More.iPhone.Development.with.Objective-C.3rd.Edition

    Title: More iPhone Development with Objective-C, 3rd Edition Author: Alex Horovitz, David Mark, Jayant Varma, Jeff LaMarche, Kevin Kim Length: 512 pages Edition: 3 Language: English Publisher: Apress ...

    Learn Objective-C on the Mac

    Learn Objective-C on the Mac: For OS X and iOS, Second Edition updates a best selling book and is an extensive, newly updated guide to Objective-C. Objective-C is a powerful, object-oriented ...

    Using Swift with Cocoa and Objective-C完整中文CocoaChina精校版

    Objective Objective Objective Objective-C选择器 选择器 (Selectors)(Selectors)(Selectors) (Selectors)(Selectors)(Selectors)(Selectors) 15 2.2. 2.2. 使用 Objective Objective Objective Objective-C特性...

    The Objective-C 2.0 Programming Language

    1、Introduction to The Objective-C 2.0 Programming Language 2、Objects and Classes 3、Defining a Class 4、Categories and Extensions 5、Properties 6、Protocols 7、Fast Enumeration 8、How Messaging ...

    More.iPhone.Development.with.Objective-C.3rd.Edition.1430260378

    If you are looking to extend your iOS programming skills beyond the basics then More iPhone Development with Objective-C is for you. Authors Dave Mark, Jayant Varma, Jeff LaMarche, Alex Horovitz, and ...

    Programming in Objective-C 4th Edition

    An Objective-C Class for Working with Fractions 30 The @interface Section 33 Choosing Names 34 Class and Instance Methods 35 The @implementation Section 37 The program Section 39 Accessing Instance ...

    jastor:自动将NSDictionary转换为Objective-C类的实例,支持嵌套类型和数组

    Jastor是一个Objective-C基类,它使用字典进行初始化(可能是从JSON响应中进行初始化),并将字典值分配给其所有(派生类)键入的@properties。 它支持嵌套类型,数组,NSString,NSNumber,NSDate等。 Jastor...

    iOS 7 Programming Fundamentals

    Explore Cocoa’s use of Objective-C linguistic features, Use Cocoa’s event-driven model and major design patterns, Learn the role of accessors, key-value coding, and properties, Understand the power...

    ObjC.pdf官方文档

    The Objective-C Programming Language Tools & Languages: Objective-C Chapter 1 Objects, Classes, and Messaging Chapter 2 Defining a Class Chapter 3 Allocating and Initializing Objects Chapter 4 ...

    Cocoa Fundamentals Guide

    The Dynamism of Objective-C 57 Extensions to the Objective-C Language 58 Using Objective-C 64 The Root Class 66 NSObject 67 Root Class—and Protocol 67 Overview of Root-Class Methods 68 Interface ...

    Head First iPhone and iPad Development, 3rd Edition

    Put Objective-C core concepts to work, including message passing, protocols, properties, and memory management Take advantage of iPhone OS patterns such as datasources and delegates Preview your ...

    03.-Properties-Part-1-:物镜

    03.-Properties-Part-1-:物镜

    Head First iPhone and iPad Development

    Put Objective-C core concepts to work, including message passing, protocols, properties, and memory management Take advantage of iPhone OS patterns such as datasources and delegates Preview your ...

    Swift.Pocket.Reference.Programming.for.iOS.and.OS.X.2nd.Edition.149194

    Designed to work with Cocoa and Cocoa Touch, Swift can be used in tandem with Objective-C, and either language can call APIs implemented in the other. Swift is still evolving, but Apple clearly sees ...

    Notepad++ 代码编辑器

    为了产生小巧且有效率的... VB/VBS source files (画面), SQL (画面), Objective-C (画面), CSS, Pascal, Perl, Python, Lua, TCL, Assembler, Ruby, Lisp, Scheme, Properties, Diff, Smalltalk, Postscript 及 VHDL.

    iOS Programming (第四版英文版)- The Big Nerd Ranch Guide 4ed

    We have adopted a more modern style of Objective-C in this edition . We use properties, dotnotation , auto-synthesized instance variables, t h e n ew l i t eral s, an d su bscript in g ex t en sively ...

    Swift 3 Object-Oriented Programming

    Swift 3 Object Oriented Programming - Second Edition by Gastón C. Hillar English | 6 Mar....Understand the differences between Swift 3.0, previous Swift versions, and Objective-C code

    notepad++ v6.0

     PHP CSS makefile ASCII艺术(.nfo) doxygen ini文件 批处理文件 Javascript ASP VB/VBS SQL Objective-C RC资源文件 Pascal Perl Python Lua TeX TCL 汇编语言 Ruby Lisp Scheme Properties Diff Smalltalk Post...

Global site tag (gtag.js) - Google Analytics