摘要:
You want to be able to allow your users to share content inside your apps with theirfriends, through an interface, such as Facebook and Twitter.SolutionCreate an instance of the UIActivityViewController class and share your contentthrough this class.eg:you have a text field where the user can enter 阅读全文
摘要:
Presenting and Managing Views with UIViewControllerProblemYou want to switch among different views in your application.SolutionUse the UIViewController class.(Apple’s strategy for iOS development was to use the model-view-controller (MVC) divisionof labor. Views are what get displayed to users, whil 阅读全文
摘要:
You would like to present a few options to your users from which they can pick anoption, through a UI that is compact, simple, and easy to understand.effect:1. declare control#import "ViewController.h"@interface ViewController ()@property (nonatomic, strong) UISegmentedControl *mySegmented 阅读全文
摘要:
Picking the Date and Time with UIDatePickereffect:1. declaring a property of type UIDatePicker#import "ViewController.h"@interface ViewController ()@property (nonatomic, strong) UIDatePicker *myDatePicker;@end@implementation ViewController...2. instantiate the date picker- (void)viewDidLoa 阅读全文
摘要:
Creating and Using Switches with UISwitchYou would like to give your users the ability to turn an option on or off.effect as follow:SolutionUse the UI... 阅读全文
摘要:
1. Viewspresentation:A view (an object whose class is UIView or a subclass of UIView) knows how to draw itself into a rectangular area of the interface.eg: you can drag an interface widget, such as a UIButton, into a view in the nib editor; when the app runs, the button appears, and works properly.i 阅读全文
摘要:
synthesize creates setter and getter(从Objective-C 2.0开始,合成可自动生成存取方法)the setter is used by IOS to set the pointer of the object on storyboardwe uses getter anytime we want to call the object on storyboard and send messages属性合成的步骤:1) 在接口部分(也就是头文件)使用@property指令标识属性 eg: @property int numerator, denomina 阅读全文
摘要:
http://my.oschina.net/sunboy2050/blog/55749 阅读全文
摘要:
names = { "小林", "林", "大卫", "玛丽" }names.each { |name| if /林/ = ~name puts name end}运行结果:小林林 阅读全文
摘要:
https://www.dropbox.com/business 阅读全文