티스토리 뷰
저의 경우 탭바 형식에 네비게이션 컨트롤러를 넣어서 그 컨트롤러의 타이틀을 지정할때 사용하였습니다.
사용예제는 아래와 같습니다.
- (id) initWithCoder:(NSCoder *)aDecoder
{
if (self=[super initWithCoder:aDecoder])
{
self.title = @"INSERT Title NAME";
}
return self;
}
참고용으로 개발자 문서의 레퍼런스를 올립니다.
NSCoding Protocol Reference
Adopted by |
Various Cocoa classes
|
Framework |
/System/Library/Frameworks/Foundation.framework
|
Availability |
Available in iOS 2.0 and later.
|
Companion guide | |
Declared in |
NSObject.h
|
Overview
The NSCoding
protocol declares the two methods that a class must implement so that instances of that class can be encoded and decoded. This capability provides the basis for archiving (where objects and other structures are stored on disk) and distribution (where objects are copied to different address spaces).
In keeping with object-oriented design principles, an object being encoded or decoded is responsible for encoding and decoding its instance variables. A coder instructs the object to do so by invoking encodeWithCoder:
orinitWithCoder:
. encodeWithCoder:
instructs the object to encode its instance variables to the coder provided; an object can receive this method any number of times. initWithCoder:
instructs the object to initialize itself from data in the coder provided; as such, it replaces any other initialization method and is sent only once per object. Any object class that should be codable must adopt the NSCoding
protocol and implement its methods.
It is important to consider the possible types of archiving that a coder supports. On Mac OS X version 10.2 and later, keyed archiving is preferred. You may, however, need to support classic archiving. For details, see Archives and Serializations Programming Guide.
Tasks
Initializing with a Coder
– initWithCoder:
required method
Encoding with a Coder
– encodeWithCoder:
required method
Instance Methods
encodeWithCoder:
Encodes the receiver using a given archiver. (required)
Parameters
- encoder
An archiver object.
Availability
- Available in iOS 2.0 and later.
Declared In
NSObject.h
initWithCoder:
Returns an object initialized from data in a given unarchiver. (required)
Parameters
- decoder
An unarchiver object.
Return Value
self
, initialized using the data in decoder.
Availability
- Available in iOS 2.0 and later.
Declared In
NSObject.h
'헉!! > iOS' 카테고리의 다른 글
[iOS] iOS8.0 이상에서 위치정보 사용 설정 (0) | 2015.11.18 |
---|---|
[iOS 개발] 네비게이션바의 배경색(background color)을 바꾸기 위한 메소드 (0) | 2011.09.15 |
[iOS 개발] UIPickerViewDataSource Protocol Reference (6) | 2011.09.14 |
[iOS 개발] UIPickerViewDelegate Protocol Reference (0) | 2011.09.14 |
[iOS 개발] pickerView:numberOfRowsInComponent (0) | 2011.09.14 |
- Total
- Today
- Yesterday
- 오블완
- JavaScript
- Object C
- Spring
- 자바스크립트
- 오브젝트 C
- 티스토리챌린지
- SQL
- MAC OSX 10.7
- MySQL
- 제이쿼리
- 자바
- 오브젝티브 C
- jQuery
- 아이폰 개발
- Spring Framework
- Objective C
- zero
- 아이폰 어플리케이션
- 아이폰
- iOS 개발
- iPhone
- oracle
- IT
- Programming
- JSP
- Objective-C
- tomcat
- Java
- iBATIS
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |