1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
//
定义结构体 struct
NoteGroup { CGRect
rect; int
page; }; typedef
struct
NoteGroup NoteGroup; //
存入集合 NoteGroup
noteGroup = {rect, 3}; [array
addObject:[NSValue valueWithBytes:¬eGroup objCType:@encode(NoteGroup)]]; //
取出 NoteGroup
noteGroup; NSValue
*noteGroupValue = array[index]; [noteGroupValue
getValue:¬eGroup]; |
Struct 在iOS中的集合中使用
最新推荐文章于 2021-06-08 16:52:01 发布