随笔分类 - iOS
摘要:Cocoa是OS X和iOS操作系统的应用程序环境。它由面向对象类库、运行时和集成开发环境组成。The Cocoa EnvironmentCocoa是一个面向对象框架集,为OS X和iOS应用程序提供了一个运行时环境。Cocoa是OS X上一个出众的应用程序环境,并且是iOS上唯一的应用程序环境。Introducing Cocoa与所有应用程序环境一样,Cocoa有运行时和开发两个方面。在运行时方面,Cocoa应用程序展示用户界面,并且与操作系统其它可视化组件紧密集成;如在OS X中,这些应用有Finder,Dock及其它应用程序。但是,程序员更感兴趣的是开发方面。Cocoa提供了一个类库用于
阅读全文
摘要:原文:https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/CocoaFundamentals/Introduction/Introduction.html“What Is Cocoa?” introduces Cocoa from a functional and broadly architectural perspective, describing its features, frameworks, and development environment.从功能性和大体架构的角度描述Cocoa的各种
阅读全文
摘要:Creating Navigation Controllers–initWithRootViewController:–initWithNavigationBarClass:toolbarClass:Accessing Items on the Navigation StacktopViewControllerpropertyvisibleViewControllerpropertyviewControllersproperty–setViewControllers:animated:Pushing and Popping Stack Items–pushViewController:anim
阅读全文
摘要:iOS程序是基于MVC设计模式的,UIViewController是Controller的基类,一般我们通过继承这个类来实现自己的Controller,框架为我们提供了一些定义好的子类,如UINavigationController,UITabbarControllerCreating a View Controller Using Nib Files–initWithNibName:bundle:nibNamepropertynibBundlepropertyUsing a Storyboard–shouldPerformSegueWithIdentifier:sender:–perform
阅读全文
摘要:UIDatePicker,日期选取器typedef NS_ENUM(NSInteger, UIDatePickerMode) { UIDatePickerModeTime, // Displays hour, minute, and optionally AM/PM designation depending on the locale setting (e.g. 6 | 53 | PM) UIDatePickerModeDate, // Displays month, day, and year depending on the local...
阅读全文
摘要:UIPickerView,使用UIPickerViewDataSource来配置数据,UIPickerViewDelegate来控制内容。@interface UIPickerView : UIView @property(nonatomic,assign) id dataSource; // default is nil. weak reference@property(nonatomic,assign) id delegate; // default is nil. weak reference@property(nona...
阅读全文
摘要: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_
阅读全文
摘要: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...
阅读全文
摘要:UIResponder是程序中可响应类的基类,主要提供了与用户交互的一些事件和属性等。firstResponder表示当前与用户交互的控件,常用的方法resignFirstResponder使用控件失去响应。@interface UIResponder : NSObject { @private}- (UIResponder*)nextResponder;- (BOOL)canBecomeFirstResponder; // default is NO- (BOOL)becomeFirstResponder;- (BOOL)canResignFirstResponder; // ...
阅读全文
摘要:Cocoa touch layer包含了一些框架,它是专用于ios系统的,使用这些框架可以访问关键的设备特性。AddressBookUIEventKitUIGameKitiAdMapKitMessageUITwitterUIKit这些框架里面最主要的就是UIKit,它提供了ios应用程序最基本的部分。下面是UIKit的简易类继承图NSObjectUIResponderUIApplicationUIViewUIWindowUILabelUIPickerViewUIProgressViewUIActivityIndicatorViewUIImageViewUITabBarUIControlUIBu
阅读全文
摘要:UIApplication,用于应用程序级别的管理,实例是由系统自动创建的,通过类方法sharedApplication获取UIApplication实例。typedef NS_ENUM(NSInteger, UIStatusBarStyle) { UIStatusBarStyleDefault, UIStatusBarStyleBlackTranslucent, UIStatusBarStyleBlackOpaque};typedef NS_ENUM(NSInteger, UIStatusBarAnimation) { UIStatusBarAnimationNone...
阅读全文
摘要: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...
阅读全文
摘要:@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;.
阅读全文

浙公网安备 33010602011771号