아이폰어플개발정보2011. 3. 12. 17:14


//사용 예

- (void)sample {

NSMutableArray *a = [NSMutableArray array];

CGPoint p = CGPointMake(5.0, 6.0);

NSDictionary *pointObject = [NSDictionary dictionaryWithCGPoint:p];

[a addObject:pointObject];

[a addObject:[NSDictionary dictionaryWithCGSize:CGSizeMake(50.0, 60.0)]];

CGRect rect = CGRectMake(20.0, 40.0, 100.0, 60.0);

[a addObject:[NSDictionary dictionaryWithCGRect:rect]];

NSLog(@"%@",a);

CGPoint point = [pointObject CGPointValue];

CGSize size = [[a objectAtIndex:1] CGSizeValue];

CGRect rect2 = [[a objectAtIndex:2] CGRectValue];

NSLog(@"point: %f,%f",point.x,point.y);

NSLog(@"size: %f,%f",size.width,size.height);

NSLog(@"rect: %f,%f,%f,%f",rect2.origin.x,rect2.origin.y,rect2.size.width,rect2.size.height);

}



출처 : http://blog.naver.com/PostView.nhn?blogId=hana_815&logNo=60120337801
Posted by 오늘마감

댓글을 달아 주세요