Nspoint\cgpoint (Common) nssize\cgsize (common) nsrect\cgrect (common) Nsrange
Nspoint P1 = Nsmakepoint (10, 10);
Cgpoint P2 = cgpointmake (10, 20); Common
nssize S1 = nsmakesize (50, 50);
Cgsize s2 = cgsizemake (50, 100); Common
Cgpointzero = = Cgpointmake (0, 0); Cgpointzero indicates the origin (corresponding: Cgsizezero Cgrectzero)
How CGRect is created
CGRect r1 = CGRectMake (10, 10, 50, 50);
CGRect r2 = {{0, 0}, {100, 100}};
CGRectMake R3 = {p1, s1};
The premise of using Cgpointzero is to add the Coregraphics framework
CGRect R4 = {Cgpointzero, Cgsizemake (80, 90)};
convert struct to String
NSString *str1 = Nsstringfrompoint (p1);
NSString *str2 = nsstringfromsize (S1);
NSString *STR3 = nsstringfromrect (r1);
Nsrange
Nsrange r1 = Nsmakerange (3, 5);
NSString *STR4 = @ "as God name";
Find the range of a string in str
If not found, length = 0, location = = Nsnotfound = =-1
Nsrange range = [str rangeofstring:@ "God"];
NSLog (@ "location =%ld, length =%ld", range.location, Range.length);
OC--Structural body