This repository was archived by the owner on Jul 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNodeModelStrings.plist
More file actions
executable file
·114 lines (88 loc) · 2.79 KB
/
NodeModelStrings.plist
File metadata and controls
executable file
·114 lines (88 loc) · 2.79 KB
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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>dictionaryTypeString</key>
<string> // [PropertyName]
if ([key isEqualToString:@"[PropertyName]"] && [value isKindOfClass:[NSDictionary class]]) {
value = [[[PropertyClass] alloc] initWithDictionary:value];
}
</string>
<key>arrayTypeString</key>
<string> // [PropertyName]
if ([key isEqualToString:@"[PropertyName]"] && [value isKindOfClass:[NSArray class]]) {
NSArray *array = value;
NSMutableArray *dataArray = [NSMutableArray array];
for (NSDictionary *dictionary in array) {
[PropertyClass] *model = [[[PropertyClass] alloc] initWithDictionary:dictionary];
[dataArray addObject:model];
}
value = dataArray;
}
</string>
<key>modelMFileString</key>
<string>//
// [ModelName-WaitForReplaced].m
//
// http://www.cnblogs.com/YouXianMing/
// https://github.com/YouXianMing
//
// Copyright (c) YouXianMing All rights reserved.
//
#import "[ModelName-WaitForReplaced].h"
@implementation [ModelName-WaitForReplaced]
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
/* [Example] change property id to productID
*
* if([key isEqualToString:@"id"]) {
*
* self.productID = value;
* return;
* }
*/
// show undefined key
NSLog(@"%@.h have undefined key '%@', the key's type is '%@'.", NSStringFromClass([self class]), key, [value class]);
}
- (void)setValue:(id)value forKey:(NSString *)key {
// ignore null value
if ([value isKindOfClass:[NSNull class]]) {
return;
}
[ListProperties-WaitForReplaced]
[super setValue:value forKey:key];
}
- (instancetype)initWithDictionary:(NSDictionary *)dictionary {
if ([dictionary isKindOfClass:[NSDictionary class]]) {
if (self = [super init]) {
[self setValuesForKeysWithDictionary:dictionary];
}
}
return self;
}
@end
</string>
<key>modelHeaderFileString</key>
<string>//
// [ModelName-WaitForReplaced].h
//
// http://www.cnblogs.com/YouXianMing/
// https://github.com/YouXianMing
//
// Copyright (c) YouXianMing All rights reserved.
//
#import <Foundation/Foundation.h>
[FileHeaders-WaitForReplaced]
@interface [ModelName-WaitForReplaced] : NSObject
[PropertiesList-WaitForReplaced]
/**
* Init the model with dictionary
*
* @param dictionary dictionary
*
* @return model
*/
- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
@end
</string>
</dict>
</plist>