Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
新しい Objective-C 構文を使用して、配列に新しいオブジェクトを追加する方法。
などであることは知っていますがaddObject:、addObjectAtIndex:新しい方法で行うように依頼されました。
addObject:
addObjectAtIndex:
新しいやり方とは?
NSMutableArray *mArray = [NSMutableArray new]; mArray[mArray.count] = @"newvalue"; // this can be any object
上記は と同等addObject:です。
これは必読です。