摘要: UIControl,是所有可响应事件控件的基类,通过观察者模式实现了事件的处理,注册事件观察者// target是注册的观察者,action为响应方法,后边是观察的事件- (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents;发送事件// 触发某控件的事件- (void)sendAction:(SEL)action to:(id)target forEvent:(UIEvent *)event;控件具有几种状态,常用的是前面4种,看后面注释typedef NS_ 阅读全文
posted @ 2013-08-12 11:20 万有引用 阅读(598) 评论(0) 推荐(0) 编辑
摘要: UIView是程序中所有可见元素的基类。@interface UIView : UIResponder { + (Class)layerClass; // default is [CALayer class]. Used when creating the underlying layer for the view.- (id)initWithFrame:(CGRect)frame; // default initializer@property(nonatomic,getter=isUserInteractionEnabled... 阅读全文
posted @ 2013-08-12 11:08 万有引用 阅读(866) 评论(0) 推荐(0) 编辑
摘要: UIResponder是程序中可响应类的基类,主要提供了与用户交互的一些事件和属性等。firstResponder表示当前与用户交互的控件,常用的方法resignFirstResponder使用控件失去响应。@interface UIResponder : NSObject { @private}- (UIResponder*)nextResponder;- (BOOL)canBecomeFirstResponder; // default is NO- (BOOL)becomeFirstResponder;- (BOOL)canResignFirstResponder; // ... 阅读全文
posted @ 2013-08-12 11:00 万有引用 阅读(472) 评论(0) 推荐(0) 编辑
摘要: Cocoa touch layer包含了一些框架,它是专用于ios系统的,使用这些框架可以访问关键的设备特性。AddressBookUIEventKitUIGameKitiAdMapKitMessageUITwitterUIKit这些框架里面最主要的就是UIKit,它提供了ios应用程序最基本的部分。下面是UIKit的简易类继承图NSObjectUIResponderUIApplicationUIViewUIWindowUILabelUIPickerViewUIProgressViewUIActivityIndicatorViewUIImageViewUITabBarUIControlUIBu 阅读全文
posted @ 2013-08-12 10:50 万有引用 阅读(242) 评论(0) 推荐(0) 编辑
摘要: UIApplication,用于应用程序级别的管理,实例是由系统自动创建的,通过类方法sharedApplication获取UIApplication实例。typedef NS_ENUM(NSInteger, UIStatusBarStyle) { UIStatusBarStyleDefault, UIStatusBarStyleBlackTranslucent, UIStatusBarStyleBlackOpaque};typedef NS_ENUM(NSInteger, UIStatusBarAnimation) { UIStatusBarAnimationNone... 阅读全文
posted @ 2013-08-12 10:43 万有引用 阅读(1486) 评论(0) 推荐(0) 编辑
摘要: NS_CLASS_AVAILABLE_IOS(2_0) @interface UISwitch : UIControl { @private id _control;}@property(nonatomic, retain) UIColor *onTintColor NS_AVAILABLE_IOS(5_0) UI_APPEARANCE_SELECTOR;@property(nonatomic, retain) UIColor *tintColor NS_AVAILABLE_IOS(6_0) UI_APPEARANCE_SELECTOR;@property(nonatomic, re... 阅读全文
posted @ 2013-08-12 10:27 万有引用 阅读(272) 评论(0) 推荐(0) 编辑
摘要: @interface UIAlertView : UIView - (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id /**/)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION; @property(nonatomic,assign) id/**/ delegate;. 阅读全文
posted @ 2013-08-12 10:24 万有引用 阅读(354) 评论(0) 推荐(0) 编辑
摘要: Objective-C是动态语言,每个类class都会在运行时创建一个类对象。NSObject是根类,当然是最重要的一个类,提供的一些公共方法,顾名思议。@protocol NSObject// 是否引用同一对象- (BOOL)isEqual:(id)object;- (NSUInteger)hash;- (Class)superclass;- (Class)class;- (id)self;- (NSZone *)zone NS_AUTOMATED_REFCOUNT_UNAVAILABLE;- (id)performSelector:(SEL)aSelector;- (id)performS 阅读全文
posted @ 2013-08-12 09:58 万有引用 阅读(780) 评论(0) 推荐(0) 编辑
摘要: Bundle是Cocoa 应用程序中资源的组织方法,它是一个以.bundle为扩展名的文件夹,Cocoa 提供了对它操作的方法。@interface NSBundle : NSObject {@private NSUInteger _flags; id _cfBundle; NSUInteger _reserved2; Class _principalClass; id _tmp1; id _tmp2; void ... 阅读全文
posted @ 2013-08-12 09:46 万有引用 阅读(1020) 评论(0) 推荐(0) 编辑
摘要: Cocoa中,通知中心实现的观察者设计模式。通过下面两个类实现通知的发送和接收。/**************** Notifications ****************/@interface NSNotification : NSObject - (NSString *)name;- (id)object; // 发送该通知的对象- (NSDictionary *)userInfo; // 额外的可选信息@end@interface NSNotification (NSNotificationCreation)+ (id)notificationWithName:(NSSt... 阅读全文
posted @ 2013-08-12 09:30 万有引用 阅读(417) 评论(0) 推荐(0) 编辑