1.NSRange
初始化方法:
(1) NSRange range;
-
range.location = 3;
-
range.length = 5;
(2)
-
NSRange range = {3, 5};
-
或NSRange range = {.location = 3, .length = 5};
(3)Foundation 框架提供的快捷函数NSMakeRange
-
NSRange range = NSMakeRange(7, 3);
-
打印方法:
-
NSString *str = NSStringFromRange(range);
-
NSLog(@”%@”,str);
2.NSPoint
-
NSPoint p = NSMakePoint(2,6);
-
p = CGPointMake(2,6);
3.NSSize
-
NSSize size;
-
size = NSMakeSize(3, 6);
-
size = CGSizeMake(6, 8);
-
NSString *str = NSStringFromSize(size);
-
NSLog(@"%@",str);
4.NSRect
-
NSRect rect;
-
rect = NSMakeRect(1.0, 2.2, 5, 6);
-
rect = CGRectMake(2, 3, 6, 8);
-
NSString *str = NSStringFromRect(rect);
-
NSLog(@"%@",str);
阅读(2509) | 评论(0) | 转发(0) |