01 2015 档案
摘要:bundle是一个目录,其中包含了程序会使用到的资源. 这些资源包含了如图像,声音,编译好的代码,nib文件(用户也会把bundle称为plug-in). 对应bundle,cocoa提供了类NSBundle.我们的程序是一个bundle. 在Finder中,一个应用程序看上去和其他文件没有什么区别...
阅读全文
摘要:#import "ViewController.h"@import MediaPlayer;@interface ViewController (){ MPMoviePlayerController *_mov;}@property (weak, nonatomic) IBOutlet UIImag...
阅读全文
摘要:CAEmitterLayer *snowEmitter = [CAEmitterLayer layer]; //例子发射位置 snowEmitter.emitterPosition = CGPointMake(120,20); //发射源的尺寸大小 snowEmitter.emitterSi...
阅读全文
摘要:#import "ViewController.h"@interface ViewController (){ CALayer *_l1;//定义能够全局使用 CALayer *_l2;}@end@implementation ViewController- (void)viewDidLoad { ...
阅读全文
摘要:- (void)setTitle:(NSString *)title forState:(UIControlState)state;//设置标题- (void)setTitleColor:(UIColor *)color forState:(UIControlState)state;//设置标题颜色...
阅读全文
摘要:《 UIControl》1 处理用户事件的控件的基类,如UIButton,UISlider等2 一般不直接实例化,而是使用他的子类3 可以通过跟踪触摸事件来设置和获取控件状态,并且这些方法可以被子类继承//添加一个事件- (void)addTarget:(id)target action:(SEL)...
阅读全文
摘要://通过xib文件创建一个视图控制器。并作为窗口的根控制器self.viewController = [[ViewController alloc] initWithNibName:@"ViewController"bundle:nil];//通过代码创建一个视图控制器,self.viewContr...
阅读全文
摘要:UIImageView的作用是显示图片和多张动态的图片- (id)initWithImage:(UIImage *)image;//初始化图片视图- (id)initWithImage:(UIImage *)image highlightedImage:(UIImage *)highlightedI...
阅读全文
摘要:UILabel 的作用是显示文本UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(100, 100, 100, 40)]; label.text = @"代佳宏";//创建文本的内容 nillabel.textColor = [UI...
阅读全文
摘要:// AppDelegate.m#import "AppDelegate.h"#import "ViewController.h"@interface AppDelegate ()@end@implementation AppDelegate- (BOOL)application:(UIApplic...
阅读全文