如果这是重复,请原谅我.我认为这肯定是个明显的问题.
我在故事板中有一个容器,它是ModelViewController类(整个视图控制器).从ModelViewController我需要获取容器的宽度和高度.我目前正在尝试:
self.view.bounds.size
Run Code Online (Sandbox Code Playgroud)
产生0.563380和0.000000.我也试过了
self.view.frame.size
Run Code Online (Sandbox Code Playgroud)
这产生了整个屏幕的尺寸.我在这里错过了什么?
假设生成器已播种,可以在不更改的情况下查看下一个随机值?
即给出:
#include <stdlib.h>
int r;
r = rand(); // say this is 99
r = rand(); // say this is 80
Run Code Online (Sandbox Code Playgroud)
这可能吗
#include <stdlib.h>
int r;
r = peekAtRand(); // this will give 99
r = rand(); // but this still gives 99
r = peekAtRand(); // this will give 80
r = rand(); // but this still gives 80
Run Code Online (Sandbox Code Playgroud)
此外,这可以扩展到下一个n号码偷看吗?