xcode在load ibaction上运行

时间:2014-10-15 02:56:30

标签: ios xcode ibaction

我正试图在加载时使用yespic show。我是xcode的新手。很多ASP经典体验。目前,当此视图控制器出现时,没有图像。然后,如果您按下是的,将显示一个图像。我想让它在加载时显示图像。我现在迷失了四天。

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    }
-(IBAction) yespic;
{
    UIImage *img =[UIImage imageNamed:@"eggplant.png"];
    [imageView setImage:img];
    // I can use this to show if they have paid for something.
}
-(IBAction) nopic;
{
    UIImage *img =nil;
    [imageView setImage:img];

}

1 个答案:

答案 0 :(得分:0)

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
        UIImage *img =[UIImage imageNamed:@"eggplant.png"];
        [imageView setImage:img];
    }

- (IBAction) yespic
{

}

- (IBAction) nopic
{
    UIImage *img =nil;
    [imageView setImage:img];

}