Search code examples
objective-ccocoansmutablearraynsmutabledictionaryobjective-c-literals

Is there a literal syntax for mutable collections?


I know I can create an NSArray with @[@"foo", @"bar"] or an NSDictionary with @{@0 : @"foo", @1 : @"bar"}.

Is there a literal syntax for creating an NSMutableArray or an NSMutableDictionary?


Solution

  • No. Just as how there isn't a syntax for creating an NSMutableString either. Mutable objects are not particularly suited to literal values.