To Lan Yi the first day of education and learning, the exclusive teaching by Liu Guobin teacher, a day down feeling very substantial, and on no basis to learn how to use the simple digital operation and Graphics Association in Xcode. Teacher Liu Teaching way more interesting vivid, class is very active, we this batch of students fewer, so the study atmosphere is rich, take today's notes to tidy up.
———————————— first is the calculation of simple numbers ———————————————
?
?
int c = 1231233123;
float a = 10;
float B = 232.23;
float d = a-b-c;
NSLog (@ "%f", D);
UILabel *v = [[UILabel alloc]initwithframe:cgrectmake (100, 100,100,100)];
V.text = [NSString stringwithformat:@ "%f", d];
[Self.view Addsubview:v];
———————————————— and the use of random values?———————————————
?
? int x = 5;
int y = 10;
NSLog (@ "%d", x+y);
Random values
int o = arc4random ()%6; 6 is the range
UILabel *l = [[Uilabelalloc]initwithframe:cgrectmake (Arc4random ()% (320-40), Arc4random ()% (568-60), 40, 60)];
L.backgroundcolor = [Uicolor Bluecolor];
L.text = @ "AAA";
[Self.view addsubview:l];
UILabel *h = [[Uilabelalloc]initwithframe:cgrectmake (Arc4random ()% (320-40), Arc4random ()% (568-50), 40, 50)];
H.text = @ "4";
H.backgroundcolor = [Uicolor Redcolor];
[Self.view addsubview:h];
———————————— also have graphical associations ————————————
[Super Viewdidload];
_shang.text = @ "Up";
_zuo.text = @ "Left";
_xia.text = @ "Down";
_you.text = @ "right";
_zhong.text = @ "Medium";
[Self.view Addsubview:_shang];
Lan Yi IOS Learning note number arithmetic random Value Graph association