.. Or a sticky class note.
// WebView + Image Animation + Timer
// UIBarButton
UIBarButtonItem * bar = [[UIBarButtonItem alloc] initWithBarButtonSystemItem: UIBarButtonSystemItemSearch target: self action: @selector (search :)];
self.navigationItem.rightBarButtonItem = bar;
// some items in navigationItem can be set as self-defined controls
// URL
_webView.frame = self.view.frame;
NSString * str = [NSString stringWithFormat: @ "http://www.baidu.com"];
NSURL * url = [NSURL URLWithString: str];
NSURLRequest * request = [[NSURLRequest alloc] initWithURL: url];
[_webView loadRequest: request];
// string, become url, send request
// UIImageView plays animation
_tomImageView = [[UIImageView alloc] init];
_tomImageView.frame = self.view.frame;
_tomImageView.image = [UIImage imageNamed: @ "1.jpg"];
NSMutableArray * arr = [[NSMutableArray alloc] initWithCapacity: 10];
for (int i = 0; i <26; i ++) {
UIImage * image = [UIImage imageNamed: [NSString stringWithFormat: @ "cat_angry% 04d.jpg", i]];
[arr addObject: image];
}
_tomImageView.animationImages = arr;
_tomImageView.animationRepeatCount = 1;
_tomImageView.animationDuration = 2.6;
[_tomImageView startAnimating];
// Timer
self.timer = [NSTimer scheduledTimerWithTimeInterval: 1 target: self selector: @selector (change) userInfo: nil repeats: YES];
[A gull's training note] [Objective-c] [Third Day] [Personal notes]