我的窗口的rootViewController是一个UINavigationController然后..在这个导航控制器的rootViewController中,我弹出一个模态视图(一个UITabBarController)
这样的事情:
UIWindow
->UINavigationController
-->MyFirstViewController<--In this class I run following code
Run Code Online (Sandbox Code Playgroud)
[self.navigationController presentModalViewController:tabController animated:YES];
Run Code Online (Sandbox Code Playgroud)
然后是调试器警告:当旋转多个视图控制器或视图控制器而不是窗口委托时,不支持使用两阶段旋转动画
但是,如果模态视图不是tabController,则不会出现此警告.
当我在导航控制器中弹出tabController模态视图时,这种行为会对应用程序造成什么伤害?
或者我应该找到另一种方法来做到这一点?
我在这个网站上发现了几个类似的问题,但我不明白......
我有这张桌子
CREATE TABLE IF NOT EXISTS `t5` (
`id` int(11) NOT NULL auto_increment,
`a` int(11) NOT NULL,
`b` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `a` (`a`,`b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ;
Run Code Online (Sandbox Code Playgroud)
a_b是唯一的密钥.
我有这样的PHP代码
$db = DBFactory::getInstance();
$db->selectDB('test');
$db->query("insert into t5 (a, b) values(1, 1) on duplicate key update a=1, b=1");
var_dump(mysql_insert_id());
$cur = $db->query("select last_insert_id()");
var_dump(mysql_fetch_assoc($cur));
Run Code Online (Sandbox Code Playgroud)
通过运行此代码两次,在我的电脑上结果是第1
int(1)
array(1) {
["last_insert_id()"]=>
string(1) "1"
}
Run Code Online (Sandbox Code Playgroud)
第2
int(1)
array(1) {
["last_insert_id()"]=>
string(1) "2"
}
Run Code Online (Sandbox Code Playgroud)
你可以看到,两次mysql_insert_id()返回相同的值"1",这对我来说没问题,因为我想知道插入后的真实id,而不是下一个auto_increment值.
但是,当我在另一个环境中运行此代码两次时:第1次
int(1)
array(1) {
["last_insert_id()"]=> …Run Code Online (Sandbox Code Playgroud) 我从http://www.apple.com/iphone/specs.html上读到,iPhone4的屏幕分辨率为960×640像素,分辨率为326 ppi.
但是在Xcode的IPhone4.3模拟器中,当我操作显示对象时,打印[UIScreen mainScreen] .applicationFrame,它是320*480.
所以,如果我想使用图片作为我的应用程序的主屏幕背景,我应该使用哪个尺寸?640*960或320*480?
或者我应该使用哪种图像?图像的大小会对细节产生很大影响.
我以前认为[UIColor whiteColor]与[UIColor colorWithRed:1 green:1 blue:1 alpha:1]完全相同,但事实证明它不是!有谁能解释一下?
CGFloat red1, green1, blue1, alpha1;
UIColor * color1 = [UIColor whiteColor];
[color1 getRed:&red1 green:&green1 blue:&blue1 alpha:&alpha1];
NSLog(@"%f, %f, %f, %f", red1, green1, blue1, alpha1);
UIColor * color2 = [UIColor colorWithRed:1 green:1 blue:1 alpha:1];
[color2 getRed:&red1 green:&green1 blue:&blue1 alpha:&alpha1];
NSLog(@"%f, %f, %f, %f", red1, green1, blue1, alpha1);
Run Code Online (Sandbox Code Playgroud)
输出:
0.000000, 0.000000, 0.000000, -1.998628
1.000000, 1.000000, 1.000000, 1.000000
Run Code Online (Sandbox Code Playgroud)
这是不酷的..非常不愉快
我希望我的应用程序知道磁盘可用空间何时更改并更新我的视图.系统是否发送了任何通知?