Lecture 12

Cover page image

Cay S. Horstmann

Lecture 12 Question 1

Which of these is the correct code to compute the number of seconds since 1970?

  1. NSDate now = [NSDate date];
    double seconds = [now timeIntervalSince1970];    
  2. NSDate* now = [NSDate date];
    double seconds = [now timeIntervalSince: 1970];
  3. NSDate now = new NSDate();
    double seconds = now.timeIntervalSince(1970);
  4. double seconds = [[NSDate date] timeIntervalSince1970];

Lecture 12 Question 2

Which of the following code snippets will compile and run without an exception?

  1. NSDate* now = [NSDate init];
    double seconds = [now timeIntervalSince1970];
  2. NSDate* now = nil;
    double seconds = [now timeIntervalSince1970];
  3. NSDate* now = [NSDate new];
    double seconds = [now timeIntervalSince1970];
  4. None of the above

Outlets and Actions

Protocols

Action Sheets and Alerts

Action Sheets and Alerts

Action Sheet Buttons

Alerts

Reading Before Next Class

Lab

Image and Text

Managing the Keyboard

Hiding the Keyboard With a Background Tap

Action Sheets