Kvc/kvo??????????????????
???? Section Wangzz???????? Section http://blog.csdn.net/wzzvictory/article/details/9674431?????????????? ???????????????????? To increase????????????????????????? Hand?? Wangzzstrive?? ?????? Increase???? such as
???? 1th???????????? You kvc/kvo?????? Increase???????????? See???????????? Really with???? ??? Line 2?????? KVO???????? Increase?? Right???? KVC???????????? Increase?????????????? KVC?? ??? Yes
????????
Kvc/kvo?? The middle species?? Open it?????????? Increase?? Cocoa?????????????? Micro NSObject?? ?????? Nskeyvaluecoding/nskeyvalueobserving???? Just like?????? Just???????? ????????????????? Yes?? Sample???????????? Add Kvc/kvo?????????????????????? ???? Main??????????????? Yes???? Add Kvc/kvo???????????? Objective-c????? Big???? Runtime increased???????????? ???????????? Just the right heart? Add Kvc/kvo??????????? and?? Home?????????? Increase???????????????? Learn?
1?? KVC????
?????? Key-value coding increase?? All?? The?????. Yes???????? Increase?? When?????????? Map
?????? ??????????????????? by live? Force??????? and?? Home??????? and???????????? Two??????????? Yes
2?? KVO????
?????? Key-value observing increase?? All?? ?????????????????????????? of the species in the acquisition
and???????????????????????????. Yes?? Mvc?????????? Cocoa?? Add Kvo??????
? Since?????? Model?? Controller????????????? Yes
???? KVC????????
1?? Key?? Key Path
KVC????????????????? and???????????????? Increase????????? and?????????????? Section [Java] View plaincopy
1. #$ (ID) Valueforkey: (nsstring$*) key;$$
2. #$ (void) SetValue: (ID) Value$forkey: (nsstring$*) key;$$
3. #$ (ID) Valueforkeypath: (nsstring$*) keypath;$$
4. #$ (void) SetValue: (ID) Value$forkeypath: (nsstring$*) keypath;$$
?????????????????? Key?????????? Increase??????? and????????????????????? Research TelePresence??????????????????. KeyPath?????????? To give??? Force action????????? and???????? In??????????? Research TelePresence Love??? Yes???? KeyPath Address.street????? and?? Is??????????????? No?? Address????????? No?????? Street????? Yes???? KeyPath???????????????????????? To give??? and?? When????????????????? People????????? Yes, research telepresence?
2?????????? KVC
????????? and?? Home?????????? Increase?????? To???? KVC? and?????????????????? Increase????????????????? Yes????????? and?????????????? Increase?? To?????????? Increase???? KVC??????????? Ming?????????????????????? Section KVC????? and?????? What's the line?? 3?????????????? To-many?????????????????????????????????????????????????????????? Ming To-one??,???? Person?????? Name???? Increase??????????????????? Yes?????????????????? Increase???? Person???????? Friendsname???? Increase??????? Son?? Ming?? Objective-c???????? Nsarray increased Nsset???? Increase?? Said??????????????????????????? Yes?? To give???????????????????????? Increase?????????????? The
?????? To give??
Yes???? KVC????????? Child?????? Increase????????? Child?????? To give??? Child??????????? Yes
?????? To give??
???????????????????????? Development of increased?????????? After????? I'll??????????????????.
? and??? Child?????????????? No??? Yes
?? The?????????????? of love? The
[Java] View plaincopy
#countOf <key>$$
//???????????????? Nsarray?????????? count:$$
#objectIn <key>atindex:$$
#<key>atindexes:$$
//?????????????????????????? $NSArray $????
?? $objectAtIndex: $?? $objectsAtIndexes: $$
#get <key>:range:$$
//?????????????????????????????????????????????? $NSArray $?? ?? $getObjects: range:$$
$$
#insertObject: in<key>atindex:$$
#insert <key>:atindexes:$$
//???????????????????????? $NSMutableArray $????
?? $insertObject: atindex:$?? $insertObjects: atindexes:$$
#removeObjectFrom <key>atindex:$$
#remove <key>atindexes:$$
//???????????????????????? $NSMutableArray $????
?? $removeObjectAtIndex: $?? $removeObjectsAtIndexes: $$
#replaceObjectIn <key>atindex:withobject:$$
#replace <key>atindexes:with<key>:$$
//???????????????????????????????????????????????????? $$
?? The?????????????? of love? The
[Java] View plaincopy
#countOf <key>$$
//???????????????? Nsarray?????????? count:$$
#objectIn <key>atindex:$$
#<key>atindexes:$$
//?????????????????????????? $NSArray $????
?? $objectAtIndex: $?? $objectsAtIndexes: $$
#get <key>:range:$$
-
//?????????????????????????????????????????????? $NSArray $?? ?? $getObjects: range:$$
-
$$
-
#insertObject: in<key>atindex:$$
-
# insert<key>:atindexes:$$
-
//???????????????????????? $NSMutableArray $????
?? $insertObject: atindex:$?? $insertObjects: atindexes:$$
-
#removeObjectFrom <key>atindex:$$
-
#remove < key>atindexes:$$
-
//???????????????????????? $NSMutableArray $????
?? $removeObjectAtIndex: $?? $removeObjectsAtIndexes: $$
-
#replaceObjectIn <key>atindex:withobject:$$
-
# replace<key>atindexes:with<key>:$$
-
//??????????????????????????????????????????????????????? ??????? $$
?????????????????????????? Increase?????????????????????????? Increase???????????? ??? Increase????????????????? with all Do you have a good line? In?????? Increase???? Friends?????????????????????? A?????? Just like?????? Just???? Increase???????????? In my??????????? Line 4???????????? Key-value Validation?? KVC?????? You guys? Key?????? Value?????????????? The
[Java] View plaincopy
1. #$ (BOOL) Validatevalue: (inout$id$*) Iovalue$forkey:
(nsstring$*) Inkey$error: (out$nserror$**) outerror;$$
?????? Is??????????????????????? I'll??????. The
[Java] View plaincopy
1. #$ (BOOL) validate<key>:error:$$
???????? Name???????????? Section [Java] View plaincopy
# (BOOL) Validatename: (id$*) Iovalue$error: (nserror$*$__autoreleasing$*) outerror${$$
$$$$//$Implementation $specific$code.$$
$$$ $return $ ...; $$
}$$
?????????????????? Then????????? Yes
???? In?????? Add KVC?????????????? they????????. Increase?????????????????? Children
??? Yes???????? To increase???? CoreData??????????? Yes
5?? KVC??????????????????????????
???????????????????? Have to???? Such as???????? To increase the???????????????????????? Time.
???????? KVC????????????????????????????? Line KVC?????????????? Have to???? Such as
???????? The???????????? NSNumber?? Nsvalue???? Increase??????? Self -???? No??? Yes
???? Two?? Add Person???????? Nsinteger?????? Age????
?? Still have to
???????? The KVC really?????????? Just want to?? Age?????? First [Java] view plaincopy
1. [Person$setvalue:[nsnumberwithinteger:5] $forKey: @ "Age"];$$
???????? Age???????? NSNumber???? Add KVC?????????? NSNumber?????? Also?? Nsinteger???? Increase????????????????? and?? Home???? Think?? Age?? Yes, I can.
?????? Have to???? Increase???????? Just???? Age???? Have the first
[Java] View plaincopy
1. [person$valueforkey:@ "Age"];$$
???? Increase???? NSNumber???? Just???? Age?? Yes, I can.
???????????? Increase???????????????? NSNumber Increase???????????????? Nsvalue Yi
Room???? NSNumber????
???????? NSNumber???? The?????? Section [Java] View plaincopy
+$ (nsnumber$*) Numberwithchar: (char) value;$$
+$ (nsnumber$*) Numberwithunsignedchar: (Unsigned$char) value;$$
+$ (nsnumber$*) Numberwithshort: (short) value;$$
+$ (nsnumber$*) Numberwithunsignedshort: (unsigned$short) value;$$
+$ (nsnumber$*) Numberwithint: (int) value;$$
+$ (nsnumber$*) Numberwithunsignedint: (unsigned$int) value;$$
+$ (nsnumber$*) Numberwithlong: (Long) value;$$
+$ (nsnumber$*) Numberwithunsignedlong: (Unsigned$long) value;$$
+$ (nsnumber$*) Numberwithlonglong: (Long$long) value;$$
+$ (nsnumber$*) Numberwithunsignedlonglong: (Unsigned$long$long) value;$$
+$ (nsnumber$*) Numberwithfloat: (float) value;$$
+$ (nsnumber$*) numberwithdouble: (double) value;$$
+$ (nsnumber$*) Numberwithbool: (BOOL) value;$$
+$ (nsnumber$*) Numberwithinteger:
(Nsinteger) value$ns_available (10_5,$2_0); $$
+$ (nsnumber$*) Numberwithunsignedinteger:
(Nsuinteger) value$ns_available (10_5,$2_0); $$
???????????????????? Have to???? On the line?????? Nsvalue????
Nsvalue?????????????? Such as???????? To increase the????????????????? Child???? Such as?????? Section [Java] View plaincopy
+$ (nsvalue$*) Valuewithcgpoint: (cgpoint) point;$$
+$ (nsvalue$*) Valuewithcgsize: (cgsize) size;$$
+$ (nsvalue$*) Valuewithcgrect: (CGRect) rect;$$
+$ (nsvalue$*) Valuewithcgaffinetransform:
(Cgaffinetransform) transform;$$
+$ (nsvalue$*) Valuewithuiedgeinsets: (uiedgeinsets) insets;$$
+$ (nsvalue$*) Valuewithuioffset:
(Uioffset) Insets$ns_available_ios (5_0); $$
?????????? 6?????? and other???????????????????? Such as?????? Knowing?????? Increase?????? Such as???????????????? Nsvalue?????? Increase???????????? The???????????? To???? Section http://blog.csdn.net/wzzvictory/article/details/8614433 6?????????????? Collection Operators??
? Child??????? Force???????? Be?? Key Path increased???????? The???? Fruit?? Valueforkeypath First???? Increase?????????????????? Increase?????????? Valueforkey:???????????? Line????? Force [email protected]???????? Be??? Research telepresence???????? to the first
?? ???? Child??????? Force
???? Child??????? Force [email protected] increase @count increase @max increase @min increase @sum5?? Increase???? To??
???????????? Increase not????????????????? Yes
??????? Child?????????? Transactions increase?? Said???????????? Transaction??????
Two increases?????????????? Payee Increase amount date? line?????????? Two??????????????
??????? Force first
?????? Amount???? What???????? Section [Java] View plaincopy
1. nsnumber$*transactionaverage$=$[transactions$valueforkeypath:@ "@avg. Amount"];$$
?????? Transactions son?????????? No???????? Section [Java] View plaincopy
1. nsnumber$*numberoftransactions$=$[transactions$valueforkeypath:@ "@c ount"];$$
???????????? Add @count??????? Child??????? Force???????? Be?????? Increase????????????
???? Increase??????????????? Yes
??????????? Force
??? Child??????? Force???? can dot increase?????? And???? Just???? In???????? Increase?????????? The
[Java] View plaincopy
1. @distinctUnionOfObjects $$
2. @unionOfObjects $$?????????? Have to???? Nsarray Added new?????????????????????? Three???? Increase??????????
??????? Wen??????????????????? Son of a line???????? The
[Java] View plaincopy
1. nsarray$*payees$=$[transactions$valueforkeypath:@ "@distinctUnionOfO bjects.payee"];$$
2. nsarray$*payees$=$[transactions$valueforkeypath:@ "@unionOfObjects. P Ayee"];$$
?????????? Good???? Machine???????? Yes?????????? Increase?????????????????? Good???? Machine??? Yes
Between arrays?? Set to??? Force?????????? Can you point?? Increase??????? Child??????? No Child???????? Increase???? Is???????????? On???? The
[Java] View plaincopy
1.//$Create $the$array$that$contains$additional$arrays.$$2. Self.arrayoftransactionsarray$=$[nsmutablearray$array];$$3. $$$
4.//$ADD $the$array$of$objects$used$in$the$above$examples.$$5. [arrayoftransactionsarray$addobject:transactions];$$
6. $$$
$Add $a$second$array$of$objects; $this $array$contains$alternate$values.$$
[arrayoftransactionsarrays$addobject:moretransactions];$$
????????????? No Child????? Son?? Section Arrayoftransactionsarray?????????????? To give?? Arrayoftransactionsarray????? No??? Child???????????? Increase??
??????????????????? Force first
[Java] View plaincopy
1. @distinctUnionOfArrays $$2. @unionOfArrays $$
3. @distinctUnionOfSets $$
????????????? Child???? Arrays Increase????????????? Child???? Sets????. Sets???????????????? Three???? Add [email protected]????? The line of force?
???????????? Two???? The
[Java] View plaincopy
1. nsarray$*payees$=$[arrayoftransactionsarrays$valueforkeypath:@ "@uni
Onofarrays.payee "];$$????????????
1?? KVC?????????????? KVC?? When??????????????? and?? Home??????????? Yes????? and?? Home???????????????????? Increase?????????????????? Increase KVC?? For????? and?? Home?????? To the health???????. Yes???? Think?????????????????? Increase KVC?? Out of love???????? What's the first? Do this???? Said?? -<key>?? -is<key> Ming?????????? Have to?????????? -get<key>??? and?? Home???? Increase?????????? Increase?????????????????? To do this???? Said?????? -set<key>:?????? Increase?????????? Think?? Yes,????. -get<key>?? -set<key>:???? Increase????? Person Key??? Force???????????? Increase???? Cocoa???????????????? , huh? Wen???????? Only?????????? Increase?? Do this???? -_<key>?? -_is<key> Ming?????????? Have to???????? -_get<key>?? -_set<key>:????? ????????????? of the text room and?? Home???? Increase????????????? and???? Two????? Yes?? Two?????????????? Section <key>?? _<key>;?????????????? Increase?????? Valueforundefinedkey:?? Setvalue:forundefinedkey:????? Yes?????????? Is?????????????????? Increase?????????? The??????? People????? Line 2?? KVC/KVO???????? The??????. ???? In the acquisition of The isa-swizzling really???????? Increase?????? The runtime????????? Big????? Yes???????? On???? Yes?????????? To???? Section http://blog.csdn.net/kesalin/article/details/8194240?? When?????????????????? The middle species?? Increase??????????????????? Big???????????????? Know???? Increase?????? Know????????? People???????????? Medium-species?????? Setter????? Do you know???????????? People?? Setter?????????????????????? Increase???????????????? ????? In the acquisition of Yes???????????? Think???????????? Setter???? Increase????????? People???????? KVO??????????????? Yes???????????????? Master per KVO?????? Think???? Just?????????? To increase???? That?????? and??????????????????. Increase?????????? KVO??? Yes???? Know????????? People?? Class?????? "?? More "?????????????????? to????????? Yes???????????????????? Isa in?? In???????? Just???? Know???? Increase??????????????????
?? Know???????????? Increase???????????????? Setter????????????????? People?? Setter increased???? Didn't?? The?????????. Yes???? Know????????? People?? Dealloc?????? Learn?? Look at the micro-line????? People?????? Increase???????? Learn???? Two?? Increase??????????????? Yes???????????? To???? Objective-c?????????????? Section http://blog.csdn.net/wzzvictory/article/details/8592492???????? Increase Isa in?? In?????????????????? Increase???????????????? The person increased?????? Runtime?? of???????????????? Section Nskvonotifying_person???? Nskvonotifying_person??????? People???????? The?????????????????????? Set???? Increase class increase dealloc increase _iskvoa?
?? Class
??? Person Class??????????????????????????????????? People under??????????????????? Yes
?? Road???????? The
[Java] View plaincopy
1. NSLog (@ "self#>isa:%@", Self#>isa); $$
2. NSLog (@ "self$class:%@", [Self$class]); $$?????? KVO?????? Increase?? Road?????? The
[Java] View plaincopy
1. self#>isa:person$$
2. self$class:person$$?????? KVO???????? Increase?? Road?????? The
[Java] View plaincopy
1. self#>isa:nskvonotifying_person$$
2. self$class:person$$?????? ISA in???? Class?????????? New?? Increase??????????????????? Yes
????? Man set????????????? People?????? Set???? Increase???????? Set??????????? Heart???????????????? The
[Java] View plaincopy
1. #$ (void) Willchangevalueforkey: (nsstring$*) key$$
2. #$ (void) Didchangevalueforkey: (nsstring$*) key$$???? Add Didchangevalueforkey:?????? Beauty???? The
[Java] View plaincopy
1. #$ (void) Observevalueforkeypath: (nsstring$*) keypath$$2. $$$$$$$$$$$$$$$$$$$$$ $ofObject:(ID) object$$
3. $$$$$$$$$$$$$$$$$$$$$$$ $change:(nsdictionary$*) change$$4. $$$$$$$$$$$$$$$$$$$$$$ $context:(void$*) context$$
???? Increase?????? KVO???????????? and other??????????????? and?? Home???? Add-setvalue:forkey?????????????? The
[Java] View plaincopy
1. #$ (void) Willchangevalueforkey: (nsstring$*) key$$
2. #$ (void) Didchangevalueforkey: (nsstring$*) key$$?????????????? The????. Right????????? Self -????????? and?????????????? Increase????????
?? Up to?????? Only???????? Increase???????????? Kvo and other???????? Increase?????? KVO?????????? 1th)?????? KVC
?????? KVC Increase??????? and?? Home???? Increase????????????? and?? Home?????????? Will/didchangevalueforkey:????? Wen????? and?? Home???? Increase?????????? Setvalue:forkey?????????? Will/didchangevalueforkey:????? Yes
2)??? and?? Home??????????????? People, and?? Home???????? Will/didchangevalueforkey:????? Yes???? Increase????????? and?? Home???? of?????? Got to?? Add KVO??????????? Line 3) to???? Will/didchangevalueforkey:????? Yes???? Increase?????? KVO Increase?????? Will/didchangevalueforkey:????????????? Interbank _iskvoa
???????????? Back???????? You have to?????????? KVO????????????? Yes??????????????
1??????
?????????????????? ???????
Two?????????? Increase??????????
?????? Points?? To?????????????????? Live Increase?????? AppleScript?? Points?? To?? Increase?????????? Over????????????? Line 2??????
KVC?????????? Increase?????? KVO?? Increase???????? The???? To???? Section http://www.mikeash.com/pyblog/key-value-observing-done-right.html???????????? KVO?????????? Increase?????????? Selector???? Block???????? Increase???? Let??? Person-addobserver:forkeypath:options:context:?????? Yes??????????????? Yes???????????????? Increase???????????????????? Makvonotificationcenter?? Increase?????? GitHub
Https://github.com/mikeash/MAKVONotificationCenter?????????????????????????? KVO?? Many???? Increase?????????? Letter Line
The?????? The
http://developer.apple.com/library/ios/#documentation/cocoa/conceptual/keyvaluecoding/articles/ Keyvaluecoding.html#//apple_ref/doc/uid/10000107-sw1
http://blog.csdn.net/kesalin/article/details/8194240
KVO and KVC Finishing materials