iOS 5 by Tutorials: Tips

1 Technically speaking you don’t need to set instance variables to nil in dealloc, because the object will automatically release any instance ...

2013-08-04 16:26:18

阅读数 774

评论数 0

MyLocations

MyLocations, an app that uses Core Location framework to obtain GPS coordinations for the user's whereabout, Map Kit to show the user's favourite loc...

2013-03-21 07:50:08

阅读数 615

评论数 1

From NSDate to string

- (void)updateViewDateLabel {     NSDateFormatter *formatter = [[NSDateFormatter alloc] init];     [formatter setDateStyle:NSDateFormatterMediu...

2013-03-19 16:35:56

阅读数 609

评论数 0

Primitive values and Objects

Dictionaries cannot contain primitive values such as int and BOOL, only objects. The same thing goes for arrays. If you want to put an int or BOOL va...

2013-03-18 06:56:26

阅读数 490

评论数 0

Saving and Loading the Checklist Items

Saving - (NSString *)documentsDirectory {     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YE...

2013-03-08 06:15:37

阅读数 386

评论数 0

Editing Existing Items in Checklist

- (void)configureCheckmarkForCell:(UITableViewCell *)cell                 withChecklistItem:(ChecklistsItem *)item {     UILabel *label = (UILabel...

2013-03-06 23:00:43

阅读数 456

评论数 0

Protocols, delegate

In Objective-C, protocol is simply a name for the groups of methods. A protocol doesn't have instance variables, and it doesn't implement any methods...

2013-03-06 21:08:43

阅读数 505

评论数 0

Reading Text from Text Field

pp105 property - (void)Done {     NSLog(@"Contents of the text field: %@",self.textField.text);          //close the window     [s...

2013-03-06 00:37:10

阅读数 502

评论数 0

Deleting rows in table view Checklist

//enable swipe-to-delete - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(N...

2013-03-05 14:16:29

阅读数 472

评论数 0

Adding new items to the Checklist

pp 67 Add a navigation controller Open a new Add item screen that let the user type the text for items. - (IBAction)addItem {     ...

2013-03-05 05:34:32

阅读数 621

评论数 0

Delegates in table view

The delegation pattern The concept of delegation is very common in iOS. An object will often rely on another object to help it out with certain task...

2013-03-01 02:19:53

阅读数 210

评论数 0

data source

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 1; } - (UITableViewCell *)tableView:(UITableVi...

2013-02-28 23:15:34

阅读数 294

评论数 0

Checklists

This is the second app How it looks like pp2 : a to-do list The app lets you organise to-do items into lists and then check off these items once yo...

2013-02-28 22:19:40

阅读数 333

评论数 0

Add a simple crossfade

Add a simple crossfade after the Start Over button is pressed, so the transition back to round one  won't seem so abrupt. pp146 #import ...

2013-02-28 01:04:35

阅读数 260

评论数 0

Loads the local HTML file into the web view in the app

- (void)viewDidLoad {     [super viewDidLoad];     // Do any additional setup after loading the view from its nib.          NSString *h...

2013-02-28 00:22:41

阅读数 425

评论数 0

AboutView -- Close the second window

1 Set the Action in the second window 2 in .m file, implement the - (IBAction)close method. pp 120 // AboutViewController.m -(IBAction)clos...

2013-02-27 21:15:20

阅读数 185

评论数 0

AboutView -- Create the second window in the app

1. create the second window by new file -> objective-C class (subclass of ViewController). then .xib, .h and .m 2. set Action in the first view ...

2013-02-27 20:54:21

阅读数 220

评论数 0

Action methods vs. normal methods

The difference between an action method and a regular method: Nothing. An action method is really just the same as any other method. The only specia...

2013-02-27 15:47:28

阅读数 272

评论数 0

Let the label display variable values on screen

To do that, we need to accomplish two things: 1 Create a reference to the label so we can send it messages. 2 Give the label new text to display ...

2013-02-27 15:39:17

阅读数 226

评论数 0

Generating the random number

You can't really get a computer to generate numbers that are truly random and unpredictable, but we can employ a so-called pseudo-random generator to...

2013-02-27 12:17:21

阅读数 255

评论数 0

提示
确定要删除当前文章?
取消 删除
关闭
关闭