Object which we create can either be mutable or immutable.
For example:
Immutable : NSString *str = [[NSString alloc]init];
Mutable: NSMutableString *str = [[NSMutableString alloc]init];
When we edit Mutable Object it will change its value
example:
[str appendString:@"string"];
where as when we edit the Immutable Object it will provide the new object and does not change its value.
example:
NSString *newSting = [str2 stringByAppendingString:@"string"];
0 Comment(s)