我想添加一个进度屏幕,当用户按下安装Theos按钮时,他们知道发生了什么。
这是我的代码:
#import "RootViewController.h"
#import <UIKit/UIKit.h>
@implementation RootViewController
- (void)loadView {
self.view = [[[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Background"]];
UIButton *installButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
installButton.frame = CGRectMake(21, 80, 100, 35);
[installButton setTitle:@"Install Theos" forState:UIControlStateNormal];
[self.view addSubview:installButton];
[installButton addTarget:self action:@selector(installButtonPressed) forControlEvents:UIControlEventTouchUpInside];
}
-(void)installButtonPressed
{
system("apt-get update");
system("apt-get install perl net.howett.theos");
}
@end
我还想知道我的背景图片代码是否正确?