我有一个自定义uiview,我正在尝试更新帧大小.点击后,我会在方法中这样做.调用该方法,帧值发生变化,但屏幕上没有任何反应!
if (!touched) {
GameBox *box = (GameBox *)[self.view viewWithTag:40];
[box setFrame:CGRectMake(20, 20, 100, 73)];
NSLog(@"%f", box.frame.origin.x);
markButton.enabled = NO;
guessButton.enabled = NO;
[self.view reloadInputViews];
NSLog(@"The action bar should now be hidden");
}
else if (touched) {
guessButton.enabled = YES;
markButton.enabled = YES;
[self.view reloadInputViews];
NSLog(@"The action bar should now be visible");
}
Run Code Online (Sandbox Code Playgroud) 这是返回错误的原因:
NSMutableArray *newArray = [[[NSMutableArray alloc] initWithArray:[NSJSONSerialization JSONObjectWithData:[[[appDelegate.Matches objectAtIndex:(NSUInteger)indexPath] objectForKey:@"chat"] dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers error:nil]] addObject:[NSDictionary dictionaryWithObjectsAndKeys:message, @"message", [NSString stringWithFormat:@"%llu", appDelegate.userId], @"id", nil]];
Run Code Online (Sandbox Code Playgroud) 我无法想出这个.所有变量都可以.在php中执行之前打印出sql语句...这是完全由发送到php运行的语句
INSERT INTO 'images' ('filename', 'creator', 'date', 'notes') VALUES ('cat.sdf', 'michaelamici', '2002-07-05', 'SDfdddfdffddffdfgs')
Run Code Online (Sandbox Code Playgroud)
谢谢!
我有两个for循环,它们为视图添加了子视图.第一个添加所有子视图,但第二个for循环甚至没有执行!这是怎么回事?
- (void)createBoxes
{
for (int i; i<5; i++) {
GameBox *box = [[GameBox alloc] initWithFrame:CGRectMake((i * 64) + 7, 50, 50, 50)];
[self.view addSubview:box];
}
for (int e; e<5; e++) {
GameBox *box1 = [[GameBox alloc] initWithFrame:CGRectMake((e * 64) + 7, 107, 50, 50)];
[self.view addSubview:box1];
}
}
Run Code Online (Sandbox Code Playgroud)