How to store CGPoint or CGRect in NSArray?

来源:互联网 发布:公司网络越狱 编辑:程序博客网 时间:2024/06/06 10:02



// Storing to an array
2NSArray *myarray = [NSArray arrayWithObjects: 
3        [NSValue valueWithCGPoint:CGPointMake(10,10)],
4        [NSValue valueWithCGRect:CGRectMake(0,0,320,480)],  nil];
5 
6// Getting from the array
7NSValue *val = [myarray objectAtIndex:0];
8CGPoint p = [val CGPointValue];


原创粉丝点击