
Which of these is the correct code to compute the number of seconds since 1970?
NSDate now = [NSDate date]; double seconds = [now timeIntervalSince1970];
NSDate* now = [NSDate date]; double seconds = [now timeIntervalSince: 1970];
NSDate now = new NSDate(); double seconds = now.timeIntervalSince(1970);
double seconds = [[NSDate date] timeIntervalSince1970];
Which of the following code snippets will compile and run without an exception?
NSDate* now = [NSDate init]; double seconds = [now timeIntervalSince1970];
NSDate* now = nil; double seconds = [now timeIntervalSince1970];
NSDate* now = [NSDate new]; double seconds = [now timeIntervalSince1970];
@property (nonatomic, retain) IBOutlet UIButton *myButton;IBOutlet is #defined to the empty string, just a signal to the GUI builderIBAction is #defined to void, another signal to the GUI builder@interface SJSUAppDelegate : UIResponder <UIApplicationDelegate>
UIApplicationDelegate protocol
UIActionSheetDelegate protocolUIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Are you sure?" delegate:self cancelButtonTitle:@"No Way!" destructiveButtonTitle:@"Yes, I'm Sure!" otherButtonTitles:@"Foo", @"Bar", nil]; [actionSheet showInView:self.view];
UIActionSheetDelegate protocolactionSheet:didDismissWithButtonIndex in the controller.- (void)actionSheet:(UIActionSheet *)actionSheet
didDismissWithButtonIndex:(NSInteger)buttonIndex
{
if (buttonIndex != [actionSheet cancelButtonIndex])
{
...
}
} NSString *msg = ...; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Something was done" message:msg delegate:self cancelButtonTitle:@"Phew!" otherButtonTitles:nil]; [alert show];



lab12 just like last timeUIApplicationDelegate protocol?nameField and passwordField. They both have type UITextField- (IBAction)textFieldDoneEditing: (id)sender;and attach it to the Did End on Exit event of each text field
[sender resignFirstResponder];
- (IBAction)backgroundTap:(id)sender {
[self.nameField resignFirstResponder];
[self.numberField resignFirstResponder];
} UIControl.