Objective-C literals

雖然已經可以用了,但每次寫每次忘,記錄一下XD

array = @[ a, b, c ];
m_array = [@[ a, b, c ]mutableCopy];
dict = @{ k1 : o1, k2 : o2, k3 : o3 };
m_dict = [@{ k1 : o1, k2 : o2, k3 : o3 }mutableCopy];

char_number = @'X';
int_number = @12345;
ulong_number = @12345ul;
llong_number = @12345ll;
float_number = @123.45f;
double_number = @123.45;
bool_number = @YES;

沒有留言: