Upwork Test Answers: Get all the correct answers of most recent and possible Upwork Tests A to Z (Updated on Jan, 2016)
Cover Letter Templates: These cover letter samples are not only for Upwork job, but also you will have some idea about your real life job
 
Freelance Profile Overviews: Different Profile samples and overviews of experts, advanced and intermediate level freelancers
For Newbie of Upwork: Upwork Help - How to apply for a job in Upwork with 10 most important articles about Upwork

A to Z View - All Upwork Test Answers

iOS Programming Test Answers (updated)

Here you will find Upwork iOS Programming Test Answers of Qualification Tests for freelancers and programmers - Certification for outsourcing - Upwork, please press Ctrl + F to find your desired answers of the iOS Programming Test.

1. Consider the following code:

 (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

 // Set Background Color/Pattern
 self.window.backgroundColor = [UIColor blackColor];
 self.tabBarController.tabBar.backgroundColor = [UIColor clearColor];
 //self.window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"testbg.png"]];

 // Set StatusBar Color
 [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];

 // Add the tab bar controller's current view as a subview of the window
 self.window.rootViewController = self.tabBarController;
 [self.window makeKeyAndVisible];
 return YES;
 }

 How can the error be corrected that gets thrown in the console, "Applications are expected to have a root view controller at the end of application launch"?
 Answers: • MenuViewController *menuViewController = [[MenuViewController alloc]init]; self.window.rootViewController = menuViewController;

 2. Which of the following allows it to determine if an application is running on iPhone, or if it's running on an iPod Touch?
 Answers: • NSString *deviceType = [UIDevice currentDevice].model; if([deviceType isEqualToString:@"iPhone"])

 3. What is true about ARC and manual memory management?
 Answers: • nil out properties in dealloc under manual memory management but not in ARC.

 4. What does the "strong" property attribute do?
 Answers: • It makes the object alive, as long as there is a strong pointer to it.

 5. Which of the following is the best practice to find an active internet connection?
 Answers: • - (BOOL) connectedToInternet { Reachability *reachability = [Reachability reachabilityForInternetConnection]; NetworkStatus networkStatus = [reachability currentReachabilityStatus]; return !(networkStatus == NotReachable); }

 6. What gets returned if XIB is not properly connected to a parent controller?
 Answers: • EXEC_BAD_ACCESS

 7. What is the use of performSelector in iOS?
 Answers: • To call a method of a class

 8. Which of the following is the correct way to get the value of the first object of a NsMutableArray stored in another NsMutableArray?
 Answers: • [[myArray objectAtIndex:0] objectAtIndex:0];

 9. What is the maximum size of an iOS application?
 Answers: • 2 GB

 10. Which of the following is the correct way to set the font size of UIButton title label?
 Answers: • someButton.titleLabel.font = [UIFont systemFontOfSize: 15];


 11. Which of the following frameworks is needed to apply a border to an object?
 Answers: • QuartzCore

 12. How can it be detected if the app is running on an iPhone 5?
 Answers: • if([[UIScreen mainScreen] bounds].size.height == 568)

 13. Which of the following is not a valid Touch method with respect to Cocoa Touch programming?
 Answers: • None of above

 14. Which of the following will return the device's current location?
 Answers: • CLLocationManager locationManager = [[CLLocationManager alloc] init]; [locationManager startUpdatingLocation];

 15. Which of the following is the correct way to print out stack/trace to the console/log in Cocoa application?
 Answers: • NSLog(@”%@”,[NSThread callStackSymbols]);

 16. Which of the following is not a valid UIGestureRecognizer?
 Answers: • UIZoomGestureRecognizer

 17. Which of the following will change the placeholder text color in UITextField?
 Answers: • None of the above.

 18. Which of the following framework is needed to round corners of UILabel?
 Answers: • QuartzCore

 19. Which of the following is not a valid icon size for any iOS device (iPhone, iPod, iPad)?
 Answers: • 64 x 64

 20. Which of the following is not a valid UIGestureRecognizer?
 Answers: • UIZoomGestureRecognizer

 21. Which of the following will set an image on UIButton?
 Answers: • [button setImage:[UIImage imageNamed:@"btn_img.png"] forState:UIControlStateNormal];

 22. Select all incorrect bundle ID(s):
 Answers: • com.appName

 23. Which of the following will set the font of UISegmentedControl?
 Answers: • UIFont *font = [UIFont boldSystemFontOfSize:12.0f]; NSDictionary *attributes = [NSDictionary dictionaryWithObject:font forKey:UITextAttributeFont]; [segmentedControl setTitleTextAttributes:attributes forState:UIControlStateNormal];

 24. Which of the following correctly sets an image on UIButton?
 Answers: • [button setImage:[UIImage imageNamed:@"button_img.png"] forState:UIControlStateNormal];

 25. Which of the following font packages are supported by Cocoa-Touch?
 Answers: • .ttf (True Type Font)

 26. Which of the following is not an Open Source Framework/Library?
 Answers: • StoreKit

 27. Which of the following is the best way to add a UIToolbar above keyboard?
 Answers: • -(void)textFieldDidBeginEditing:(UITextField *)textField { [self.view addSubview:toolbar]; }

 28. Select which of the following is not UITableViewCellSelectionStyle values?
 Answers: • UITableViewCellSelectionStyleLightGray

 29. What is the correct method to define a delegate object in an ARC Environment?
 Answers: • @property (nonatomic, weak) id <MyClassDelegate> delegate;

 30. Which of the following is the best practice to find active internet connection?
 Answers: • - (BOOL) connectedToInternet { Reachability *reachability = [Reachability reachabilityForInternetConnection]; NetworkStatus networkStatus = [reachability currentReachabilityStatus]; return !(networkStatus == NotReachable); }

 31. What will be output of following code?
 NSLog(@"%.2f",[[UIDevice currentDevice].systemVersion floatValue]);
 Answers: • 6.10

 32. What is the difference between new and [[alloc]init] in iOS?
 Answers: • No difference. Both [[alloc]init] and new are used to create an object.

 33. How can the application name of an iOS project be changed?
 Answers: • Change Bundle Display Name from info.plist

 34. What could be the probable result if selector is unknown or undefined?
 Answers: • Causes application to terminate with error

 35. Is it possible to deploy beta build on any device?
 Answers: • Beta build can be deployed only on devices that are included in Mobile Provision certificate while compiling build.

 36. Which one is true regarding integrating and using custom fonts in an iOS application?
 Answers: • Adding fonts to your app plist allows usage directly in the app.

 37. Which of the following is the correct way to set UIButton's Highlight Tint color programmatically?
 Answers: • [button setTintColor:[UIColor grayColor]];

 38. Which of the following properties would be used to draw a shadow under UIView?
 Answers: • CGContextSetShadow();

 39. Which of the following is the correct way to check whether the view controller view is loaded or visible?
 Answers: • if (viewController.isViewLoaded && viewController.view.window) { // viewController is visible }

 40. Which of the following is the correct way to transfer data from one view controller to another?
 Answers: • Both 1 and 2 methods are correct.

 41. Which of the following UILabel properties help adjust text within a UILabel?
 Answers: • adjustsFontSizeToFitWidth

 42. Which of the following is the correct way to set the Navigation Bar Color of the Tab Bar Configure Menu?
 Answers: • "UINavigationController *navigationController; ... navigationController.navigationBar.tintColor = [UIColor blackColor];"

 43. What does EXC_BAD_ACCESS signal received mean in Xcode?
 Answers: • "Owning" the memory but forgetting to release

 44. Which of the following is best JSON library to be used in iOS applications?
 Answers: • JSON kit

 45. How can an SMS be sent programmatically from the iPhone (iOS 4.0 or later)?
 Answers: • Both A &B are correct answers

 46. What is the difference between assign and retain in Objective-C?
 Answers: • assign - Specifies that the setter uses simple assignment. This is the default. retain - Specifies that retain should be invoked on the object upon assignment. The previous value is sent a release message.

 47. Which property would be used to get the UDID of UIDevice on iOS?
 Answers: • [UIDevice uniqueIdentifier]

 48. When does this behavior usually happen?
 "Xcode Message: finished running <my app>" on targeted device shows, but nothing happens
 Answers: • If the app was ran on earlier devices (3G or 3GS) and arm6 was not added in Require Device Capabilities.

 49. Is it possible to set multiple architecture from Build Settings tab in Xcode for a project?
 Answers: • Yes

 50. Which framework can be used to call SOAP web services in iOS applications?
 Answers: • wsdl2objc framework

 51. What property in info.plist handles the association of file types in an iPhone application?
 Answers: • LSItemContentTypes

 52. Which method of Objective-C handles detecting the shake gesture on an iOS device?
 Answers: • - (void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration

 53. Which one is the best resolution for the following error?
 "A valid signing identity matching this profile could not be found in your keychain"
 Answers: • Renewing your provisioning profile

 54. What is the best way to show multiple lines text in the UILabel?
 Answers: • myLabel.numberOfLines = 0; CGRect currentFrame = myLabel.frame; CGSize max = CGSizeMake(myLabel.frame.size.width, 500); CGSize expected = [myString sizeWithFont:myLabel.font constrainedToSize:max lineBreakMode:myLabel.lineBreakMode]; currentFrame.size.height = expected.height; myLabel.frame = currentFrame;

 55. Which of the following correctly describes when the - (void)viewDidUnload method is called?
 Answers: • When a view is released.

 56. Which of the following is not a valid MKAnnotationView property?
 Answers: • None of these.

 57. What does a "__block" type specifier mean?
 Answers: • Modifications done with the variable marked with __block inside the block are also visible outside of it.

 58. Which of the following is not a valid MPVolumeView method?
 Answers: • - (CGRect)routeButtonRectForBounds:(CGRect)bounds

 59. Which of the following code samples will declare a variable inside a block in Objective-C?
 Answers: • [participants enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { Person *participant = (Person*)obj; Person *aPerson = nil; if ([participant.gender isEqualToString:@"M"]) { aPerson = participant; *stop = YES; } }]; return aPerson;

No comments:

Post a Comment