- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
CGRect viewRect = CGRectMake(250, 100, 30, 30);
as = [[UIImageView alloc] initWithFrame:viewRect];
as.backgroundColor=[UIColor clearColor];
UIImage *img = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"check" ofType:@"png"]];
[as setImage:img];
[self.view addSubview:as];
BOOL test= [[NSUserDefaults standardUserDefaults] boolForKey:@"switch"];
NSLog(@"%@", (test ? @"YES" : @"NO"));
if(test == YES)
{
as.hidden=NO;
}
else
{
as.hidden=YES;
}
}
Run Code Online (Sandbox Code Playgroud)
该test结果YES ,但imageView不听指挥.hidden或更新每一次当viewDidAppear.如果它不是,当我重新启动应用程序,它消失,我把它变成是我完美的展示之后,但比之后,我从来没有总是去那里,我不能让它隐藏起来.知道为什么没有反应吗?
http://127.0.0.1:8888/degis2.php?isim=%27oteller%27&Id=%271%27&oname=%27asasdasfda123445%27
知道为什么每个变量都有%27吗?
我的代码是
<form id="form1" name="form1" method="post" action="degis2.php?isim='<?php echo $isim;?>'&Id='<?php echo $id;?>'&oname='<?php echo $name;?>'">
Run Code Online (Sandbox Code Playgroud)
PHP代码正在工作,因为你可以看到它填充链接,但可能是因为"%27"它无法在数据库中找到值并返回我查询失败.
$isim=$_GET["isim"];
$id=$_GET["Id"];
$tname=$_GET["oname"];
$name=$_POST["name1"];
$aciklama=$_POST["aciklama1"];
$link=$_POST["link1"];
Run Code Online (Sandbox Code Playgroud)
这些是我需要的变量.有人可以帮我清理链接中的%27值吗?祝你今天愉快