gpt4 book ai didi

iphone - 在 "{" token 之前预期为 ")"

转载 作者:行者123 更新时间:2023-11-29 13:50:48 25 4
gpt4 key购买 nike

我有个小问题。我正在对我编写的 iOS 程序进行一些更改,但遇到了问题。我经常收到“Expected '{' before ')' token”警告,但我的编码技能不够好,无法找到问题所在。一点帮助将不胜感激。

#import "Search.h"
#import "RootViewController.h"

//button
- (IBAction)buttonPressed)sender{
RootViewController *newview = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:UIViewAnimationTransitionFl ipFromRight forView:self.view cache:YES];
[self.view addSubview:newview.view];
[UIView commitAnimations];

@implementation Search
@end

最佳答案

正确的语法是

#import "Search.h"
#import "RootViewController.h"


@implementation Search
//button
- (IBAction)buttonPressed:(id)sender {
RootViewController *newview = [[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.view cache:YES];
[self.view addSubview:newview.view];
[UIView commitAnimations];
}

@end

关于iphone - 在 "{" token 之前预期为 ")",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4570981/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com