24. NSUndoManager
Q: How many managers?
A1: It depends...
A2: ...but often one per
doc.
25. NSUndoManager
Q: How many managers?
A1: It depends...
A2: ...but often one per
doc.
NSDocument
26. NSUndoManager
Q: How many managers?
A1: It depends...
A2: ...but often one per
doc.
NSDocument
eebie # 472:
Co coa fr saved
arked as un
doc m not empty
if undo stack
62. K VO: What is it?
• Built into base NSObject
• Automated notifications of
property changes
63. K VO: What is it?
• Built into base NSObject
• Automated notifications of
property changes...
• ...but allows for manual override
64.
65. K VO: What’s a key?
• A string that identifies a property
66. K VO: What’s a key?
• A string that identifies a property
• e.g. via an accessor method or
instance variable
67. K VO: What’s a key?
• A string that identifies a property
• e.g. via an accessor method or
instance variable
These accessors...
- (void) setHeight: (NSNumber *) newHeight;
- (NSNumber *) height;
68. K VO: What’s a key?
• A string that identifies a property
• e.g. via an accessor method or
instance variable
These accessors... ...correspond to this key.
- (void) setHeight: (NSNumber *) newHeight;
@"height"
- (NSNumber *) height;
69.
70. K VO: How to use it.
1. Must be KVO compliant for
properties you want to observe
71. K VO: How to use it.
1. Must be KVO compliant for
properties you want to observe
2. Must register for each property
72. K VO: How to use it.
1. Must be KVO compliant for
properties you want to observe
2. Must register for each property
3. Observer must handle the
notification
73.
74. 1. K VO Compliance
Depends on what kind of property.
• To-one
• To-many (indexed)
• To-many (unordered)
75. 1. K VO Compliance
Depends on what kind of property:
e.g. - (void
• To-one
) setHe
- (NSNu ight: (
mber *) NSNumbe
height; r *) ne
wHeight
;
• To-many (indexed)
• To-many (unordered)
76. 1. K VO Compliance
Depends on what kind of property:
e.g. - (void
• To-one
) setHe
- (NSNu ight: (
mber *) NSNumbe
height; r *) ne
wHeight
;
• To-many (indexed)
• To-many (unordered)
- (NSUI
e.g. - (NSEn
- (id)
nteger)
umerato
countOf
r *) en
MySet;
memberO umerato
fMySet: rOfMySe
(id) an t;
Object;