{"action":"opened","issue":{"url":"https://api.github.com/repos/ChenYilong/iOSInterviewQuestions/issues/19","labels_url":"https://api.github.com/repos/ChenYilong/iOSInterviewQuestions/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/ChenYilong/iOSInterviewQuestions/issues/19/comments","events_url":"https://api.github.com/repos/ChenYilong/iOSInterviewQuestions/issues/19/events","html_url":"https://github.com/ChenYilong/iOSInterviewQuestions/issues/19","id":107595135,"number":19,"title":"第13题 疑问 对非集合类对象的copy操作","user":{"login":"arkilis","id":1528028,"avatar_url":"https://avatars.githubusercontent.com/u/1528028?v=3","gravatar_id":"","url":"https://api.github.com/users/arkilis","html_url":"https://github.com/arkilis","followers_url":"https://api.github.com/users/arkilis/followers","following_url":"https://api.github.com/users/arkilis/following{/other_user}","gists_url":"https://api.github.com/users/arkilis/gists{/gist_id}","starred_url":"https://api.github.com/users/arkilis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arkilis/subscriptions","organizations_url":"https://api.github.com/users/arkilis/orgs","repos_url":"https://api.github.com/users/arkilis/repos","events_url":"https://api.github.com/users/arkilis/events{/privacy}","received_events_url":"https://api.github.com/users/arkilis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-21T20:46:46Z","updated_at":"2015-09-21T20:46:46Z","closed_at":null,"body":"题目中给出的链接：https://www.zybuluo.com/MicroCai/note/50592\r\n\r\n    NSMutableString *string = [NSMutableString stringWithString: @\"origin\"];\r\n    //copy\r\n    NSString *stringCopy = [string copy];\r\n    NSMutableString *mStringCopy = [string copy];\r\n    NSMutableString *stringMCopy = [string mutableCopy];\r\n    //change value\r\n    [mStringCopy appendString:@\"mm\"]; //crash\r\n    [string appendString:@\" origion!\"];\r\n    [stringMCopy appendString:@\"!!\"];\r\n\r\n问什么会在这么一行Crash\r\n\r\n    [mStringCopy appendString:@\"mm\"]; //crash\r\n\r\n\r\n根据他得描述，『原因就是 copy 返回的对象是 immutable 对象』, 难道不应该是下面这一行出错吗？\r\n\r\n    NSMutableString *mStringCopy = [string copy];\r\n\r\ncopy 返回的是immutable，而所要复制的对象是 mutable.\r\n\r\n\r\n"}}