Overview
Comment: | Key Value Coding: Handle classes like objects |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
6fc7fddef1a0b1e66c562cf0d997302f |
User & Date: | js on 2016-06-05 14:07:56 |
Other Links: | manifest | tags |
Context
2016-06-05
| ||
14:32 | Implement Key Value Coding for OFDictionary check-in: cbacea7ca3 user: js tags: trunk | |
14:07 | Key Value Coding: Handle classes like objects check-in: 6fc7fddef1 user: js tags: trunk | |
13:56 | Add tests for Key Value Coding check-in: eb42896514 user: js tags: trunk | |
Changes
Modified src/OFObject+KeyValueCoding.m from [b460000a1a] to [a1b8c4dfd4].
︙ | |||
48 49 50 51 52 53 54 55 56 57 58 59 60 61 | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | + | id ret; if (typeEncoding == NULL) return [self valueForUndefinedKey: key]; switch (nextType(&typeEncoding)) { case '@': case '#': ret = [self performSelector: selector]; break; #define CASE(encoding, type, method) \ case encoding: \ { \ type (*getter)(id, SEL) = (type(*)(id, SEL)) \ [self methodForSelector: selector]; \ |
︙ | |||
137 138 139 140 141 142 143 144 145 146 147 148 149 150 | 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | + | [self setValue: value forUndefinedKey: key]; return; } switch (valueType) { case '@': case '#': { void (*setter)(id, SEL, id) = (void(*)(id, SEL, id)) [self methodForSelector: selector]; setter(self, selector, value); } break; #define CASE(encoding, type, method) \ |
︙ |
Modified tests/OFObjectTests.m from [e3b3ae9aa1] to [e7dc8eb450].
︙ | |||
32 33 34 35 36 37 38 | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | - + + - + + + - + - + | # define TOO_BIG (SIZE_MAX - 128) #endif static OFString *module = @"OFObject"; @interface MyObj: OFObject { |
︙ | |||
144 145 146 147 148 149 150 | 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | - + + - + + + - + + + + + | TEST(@"-[description]", [[o description] isEqual: [OFString stringWithFormat: @"<OFObject: %p>", o]] && [[m description] isEqual: [OFString stringWithFormat: @"<MyObj: %p>", m]]) |
︙ |