Skip to content

Commit cb299d7

Browse files
authored
Merge pull request ChenYilong#80 from machinefixer/revised_demo_13
修改 Demo_13
2 parents cc1436f + f759434 commit cb299d7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

01《招聘一个靠谱的iOS》面试题参考答案/Demo_13题_用@property声明的NSString或NSArray_NSDictionary_经常使用copy关键字_为什么_如果改用strong关键字_可能造成什么问题/CYLMutableArrayCopyDmo/CYLArrayCopyDmo/ViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ @implementation ViewController
1616

1717
- (void)viewDidLoad {
1818
[super viewDidLoad];
19-
NSMutableArray *mutableArray = [[NSMutableArray alloc] init];
2019
NSArray *array = @[ @1, @2, @3, @4 ];
20+
NSMutableArray *mutableArray = [NSMutableArray arrayWithArray:array];
2121

2222
self.array = mutableArray;
2323
[mutableArray removeAllObjects];;

01《招聘一个靠谱的iOS》面试题参考答案/《招聘一个靠谱的iOS》面试题参考答案(上).md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,8 +1226,9 @@ void objc_setProperty(id self, SEL _cmd, ptrdiff_t offset, id newValue, BOOL ato
12261226
然后进行下面的操作:
12271227

12281228
```Objective-C
1229-
NSMutableArray *mutableArray = [[NSMutableArray alloc] init];
12301229
NSArray *array = @[ @1, @2, @3, @4 ];
1230+
NSMutableArray *mutableArray = [NSMutableArray arrayWithArray:array];
1231+
12311232
self.array = mutableArray;
12321233
[mutableArray removeAllObjects];;
12331234
NSLog(@"%@",self.array);

0 commit comments

Comments
 (0)