티스토리 뷰
http://stackoverflow.com/a/9860283
Nonatomic
nonatomic
은 다중 threading 목적들에 사용된다. If we have set the nonatomic attribute at the time of declaration, then any other thread wanting access to that object can access it and give results in respect to multi-threading.
Copy
copy
는 object가 가변적일때 사용된다. Use this if you need the value of the object as it is at this moment, and you don't want that value to reflect any changes made by other owners of the object. You will need to release the object when you are finished with it because you are retaining the copy.
Assign
Assign
은 다소 copy
와 반대다. When calling the getter of an assign
property, it returns a reference to the actual data. Typically you use this attribute when you have a property of primitive type (float, int, BOOL...)
Retain
retain
은 attribute가 object에 포인터일때 필요. The setter generated by @synthesize
will retain (aka add a retain count to) the object. You will need to release the object when you are finished with it. By using retain it will increase the retain count and occupy memory in autorelease pool.
Strong
strong
은 retain attribute 대신인데, Objective-C Automated Reference Counting (ARC)의 부분으로. ARC 아닌 code 에서는 단지 retain의 동의어일 뿐.
iOS strong
과 weak
배우기위한 좋은 사이트는 아래의 링크로
http://www.raywenderlich.com/5677/beginning-arc-in-ios-5-part-1
Weak
weak
은 strong
과 유사하나 참조 카운트를 1 이상 증가시키지 않을것이다. It does not become an owner of that object but just holds a reference to it. If the object's reference count drops to 0, even though you may still be pointing to it here, it will be deallocated from memory.
위 링크는 Weak and Strong 관련한 좋은 정보들을 포함하고 있다.
'모바일 > iOS' 카테고리의 다른 글
Auto Layout 사용시 UIScrollView 스크롤 (2) | 2014.02.26 |
---|---|
message sent to deallocated instance 같은 오류 Debug (0) | 2014.02.24 |
UITable Cell, UILabel, UITextView 등에서 자동 높이 (1) | 2014.02.22 |
iOS 자동 UITableView Paging & infinite loading (0) | 2014.02.17 |
UIImageView+WebCache.h: No such file or directory 오류 해결 (0) | 2013.05.28 |
- Total
- Today
- Yesterday
- JQuery
- PHP
- nodejs
- 한글
- Android
- Wordpress
- sencha touch
- javascript
- classic asp
- Debug
- Mac
- laravel
- 안드로이드
- Linux
- Prototype
- nginx
- centos
- ASP
- IOS
- iis
- macos
- Docker
- iphone
- git
- mssql
- IE
- JSON
- 워드프레스
- CSS
- API
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |