NSRange
NSRange range = [self.displayLabel.text rangeOfString:@"."];
typedef struct _NSRange {
NSUInteger location;
NSUInteger length;
} NSRange;
如果字符串中未包含字符,那么range.location=NSNotFoundCGFloat
Just a floating point number, but we always use it for graphics.
CGPoint
C struct with two CGFloats in it: x and y.
CGPoint p = CGPointMake(34.5, 22.0); p.x += 20; // move right by 20 points
CGSize
C struct with two CGFloats in it: width and height.
CGSize s = CGSizeMake(100.0, 200.0);
s.height += 50; // make the size 50 points taller
CGRect
C struct with a CGPoint origin and a CGSize size.
CGRect aRect = CGRectMake(45.0, 75.5, 300, 500);
aRect.size.height += 45; // make the rectangle 45 points taller
aRect.origin.x += 30; // move the rectangle to the right 30 points
Enumeration
NSDictionary *myDictionary = ...;
for (id key in myDictionary) {
// do something with key here
id value = [myDictionary objectForKey:key];
// do something with value here }
Think of @“string” as autoreleased