1.非集合
? ?NSString
? ? ? (1)NSString
? ? ? ? ?copy:內(nèi)容拷貝? ? ? ? ? 不可變類(lèi)型
? ? ? ? ?mutableCopy:內(nèi)容拷貝? ? 可變類(lèi)型
? ? ? ? ?=:內(nèi)容拷貝? ? ? ? ? ? ? 不可變類(lèi)型
? ? ? (2)NSMutableString
? ? ? ? ?copy:內(nèi)容拷貝? ? ? ? ? 不可變類(lèi)型
? ? ? ? ?mutableCopy:內(nèi)容拷貝? ? 可變類(lèi)型
? ? ? ? ?=:內(nèi)容拷貝? ? ? ? ? ? ? 可變類(lèi)型
? ?String
? ? ? ? var
? ? ? ? =:內(nèi)容拷貝? ? ? ? ? ? ? 可變類(lèi)型
? ? ? ? let
? ? ? ? ?=:內(nèi)容拷貝? ? ? ? ? ? ? 不可變類(lèi)型
?2.集合
? ? ? ? NSMutableArray
? ? ? ? copy:?jiǎn)螌觾?nèi)容拷貝? ? ? ? ? 不可變類(lèi)型
? ? ? ? mutableCopy:單層內(nèi)容拷貝? ? 可變類(lèi)型
? ? ? ? =:指針拷貝? ? ? ? ? ? ? ? 可變類(lèi)型
? ? ? ? copyItems:深層內(nèi)容拷貝? ? ? 外層可變類(lèi)型
? ? ? ? NSArray
? ? ? ? copy:?jiǎn)螌觾?nèi)容拷貝? ? ? ? ? 不可變類(lèi)型
? ? ? ? ?mutableCopy:單層內(nèi)容拷貝? ? 可變類(lèi)型?
? ? ? ? ?=:指針拷貝? ? ? ? ? ? ? ? 不可變類(lèi)型
? ? ? ? ?copyItems:深層內(nèi)容拷貝? ? ? 外層可變類(lèi)型
OC:
? 非集合
? ? ? ? ?[immutableObject copy] // 淺復(fù)制 指針拷貝
? ? ? ? ?[immutableObject mutableCopy] //深復(fù)制 內(nèi)容拷貝
? ? ? ? [mutableObject copy] //深復(fù)制 內(nèi)容拷貝
? ? ? ? [mutableObject mutableCopy] //深復(fù)制 內(nèi)容拷貝
?集合
? ? ? ? ? [imMutableObject copy] // 淺復(fù)制
? ? ? ? ? [imMutableObject mutableCopy] //單層深復(fù)制
? ? ? ? ? [mutableObject copy] //單層深復(fù)制
? ? ? ? ? ?[mutableObject mutableCopy] //單層深復(fù)制