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

iPhone Programming OS 2.1 Test Answers

You will have here iPhone Programming OS 2.1 Test Answers of Upwork General Programming Category, press Ctrl + F to find your desired answers of the test questions.
--------------------------------------------------------------------------------------------------------------------------
1. Which of the following languages can be used to write the code for Xcode projects?
 Answers: • C or • C++ or • Objective-C or • Objective-C++

 2. Which of the following need to be modified while localizing an application?
 Answers: • Nib files (windows, views, menus). or • Static text. or • Icons and graphics. or • Dynamic text generated by your program.

 3. Which of the following directives are used to declare and define classes, categories, and protocols?
 Answers: • @interface or • @protocol or • @end

 4. Which of the following statements regarding Objective-C are correct?
 Answers: • In Objective-C, the keyword for NULL is nil. or • In Objective-C, for the object-oriented constructs (such as method return values), id is the default data type. or • The keyword nil has an id with a value of 0.

 5. Which of the following are valid touch attributes in a UITouch class object?
 Answers: • timestamp or • phase
 • tapCount

 6. Which of the following statements comply with the fundamental rules of Memory Management in Objective-C?
 Answers: • The ownership of the object is taken when it is created using a method the name of which begins with alloc or new or contains copy. or • The ownership of the objects is relinquished by using release or autorelease
 • autorelease just means - send a release message later

 7. The genstrings tool can parse _____.
 Answers: • C files with .c filename extension. or • Objective-C files with .m filename extension. or • Java code files with .java filename extension.

 8. Which of the following are the Derivative types defined in Objective-C?
 Answers: • short
 • long
 • long long

 9. Which of the following options regarding UIWindow and UIView classes are correct?
 Answers: • A UIWindow class object holds the contents of a UIView class object. or • Both UIWindow and UIView classes are required to display anything on the iPhone. or • UIWindow is the iPhone's base window class and the UIView class is primarily an abstract super-class.

 10. Which of the following statements regarding Memory Management are correct?
 Answers:  • The alloc method creates a new object and returns it with a reference count of 1 or • release decreases the receiver's reference count by 1 or • autorelease decreases the receiver's reference count by 1 at some point in the future


 11. Which of the following events occur when the retain count of the object drops to 0?
 Answers: • The object is deallocated. or • The dealloc method is invoked automatically

 12. Which of the following SDK classes can be used to get the location of the movement of a finger on the iPhone screen?
 Answers: • UIEvent or • UITouch


 13. You have added the following code lines in your @implementation block in your ControllerView file:

 @synthesize textField;
 @synthesize label;
 @synthesize string;

 And in your dealloc method, you have added the following code lines:

 - (void)dealloc {
 [textField release];
 [label release];
 [string release];
 [super dealloc];
 }

 What is the purpose of adding the above lines in your dealloc method?
 Answers: • To release the instance variables or • To conform to the rules of memory management

 14. Which of the following terms are related to Memory Management in Objective-C?
 Answers: • alloc or • release

 15. In your iPhone application, you want to apply an action sheet style that will display white text with transparent black background whenever a confirmation is required from the user. You have a UIActionSheet class object named "actionuser". Which of the following code snippets is the right one for applying this style?
 Answers: • [ actionuser setActionSheetStyle: 2 ];

 16. Is NSMutableArray thread safe?
 Answers: • No

 17. What is the purpose of active executable in an Xcode project?
 Answers: • To specify which program is launched and how, when you run or debug from within Xcode.

 18. Which of the following samples returns the first name of a person listed under p in the address book?
 Answers: • ABRecordCopyValue(p, kABPersonFirstNameProperty);

 19. In which file is the following function called in your application?

 int retVal = UIApplicationMain(argc, argv, nil, nil);
 Answers: • main.m only

 20. State whether the following statement is true or false:

 Interface Builder doesn't generate source code
 Answers: • False

 21. Can you place calls using the iPhone SDK?
 Answers: • Yes

 22. Can you use POSIX threads on the iPhone?
 Answers: • Yes

 23. Which of the following is the correct syntax for declaring a class in Objective-C?
 Answers: • @interface ClassName : ItsSuperclass { instance variable declarations } method declarations @end

 24. Locking all connections before editing the Nib files can be achieved by using:
 Answers: • An option in the Preferences panel of Interface Builder.

 25. What is the endianness of the network for IP communications?
 Answers: • Big endian

 26. What is the screen resolution of the iPhone 3G?
 Answers: • 480x320

 27. Which of the following methods does the UIKit provide in order to draw a string at a specific point.
 Answers: • drawAtPoint:

 28. From which of the following classes does a UITextView class object inherit its features?
 Answers: • UIView

 29. Which of the following can be used to draw a tiled image?
 Answers: • Quartz 2D function CGContextDrawTiledImage

 30. In your iPhone application, you want that the user should be able to select the date in Month, Day and Year mode. You have a UIDatePicker class object named dateModePicker. Which of the following code snippets is correct in order to apply this mode?
 Answers: • [ dateModePicker setDatePickerMode: 1 ];

 31. Which of the following is the base class for all iPhone applications?
 Answers: • UIApplication

 32. In the CALayer class, the property contentsGravity allows you to position and scale the layer's contents image within the layer bounds. What is the role of the kCAGravityLeft positioning constant in contentsGravity?
 Answers: • It positions the content image vertically centered on the left edge of the layer.

 33. Before editing the Nibs, one should:
 Answers: • Lock all connections.

 34. Given the string "192.168.1.1", how can you get an integer address (to fill a sockaddr_in structure)?
 Answers: • With inet_aton

 35. Can you use POSIX sockets on the iPhone?
 Answers: • Yes

 36. If you want to know if a host is reachable via the network, what would you use in your application?
 Answers: • SCNetworkReachabilityCreateWithName

 37. What happens if Xcode is not able to find a file or folder at the path defined for it in the project?
 Answers: • Xcode displays the item in red in the project window.

 38. In which language is the address book framework written?
 Answers: • C

 39. When the genstrings tool discovers a key string used more than once in a single strings file, it:
 Answers: • merges the comments from the individual entries into one comment string and generates a warning.

 40. Which of the following classes is used to internalize an XML into a logical tree structure?
 Answers: • NSPropertyListSerialization class

 41. What is the CompressResources build step in an iPhone Xcode project?
 Answers: • It resizes the png files in the project for displaying them in the iPhone.

 42. Can CGGradientRef be used on the iPhone to draw gradients?
 Answers: • Yes

 43. While using an iPhone, a user switches from one application to another application or service on the device. What is the most important factor to be kept in mind to ensure that your application reflects the most recent changes made by the user the next time it starts?
 Answers: • The application should be programmed to save any user changes as they are made as quickly as possible.

 44. Which of the following debugging environments are provided by Xcode to find and squash bugs in your code?
 Answers: • All of the above

 45. On the iPhone, what are the types of Person entries and Group entries?
 Answers: • ABRecordRef and ABRecordRef

 46. How do you play a short sound on the iPhone?
 Answers: • With AudioServicesPlaySystemSound function

 47. What is the function of the Code Sense feature in Xcode?
 Answers: • Code Sense maintains an index that contains important information for your project.

 48. Whenever the iPhone users switch to another application like answering the phone, or checking their email, the application they were previously using _____.
 Answers: • resumes as soon as the other application is terminated

 49. Does ABPersonCreate function add the newly created record into the address book?
 Answers: • No

 50. How can you prevent a view from receiving touch events?
 Answers: • By setting userInteractionEnabled to false

 51. Which of the following is true?
 Answers: • Each thread maintains its own stack of NSAutoreleasePool objects

 52. Refer to the given image:

 Which of the above window panes will display Build system output when Xcode builds your target and shows the corresponding warnings and errors?
 Answers: • A

 53. Which of the following classes automatically manages transition
 animation between Views?
 Answers: • UINavigationController

 54. Which of the following is not a touch event method?
 Answers: • - (void)touchesDragged:(NSSet *)touches withEvent:(UIEvent *)event;

 55. How many windows does an iPhone application typically have?
 Answers: • 1

 56. Which of the following shapes is generated by Views in an iPhone?
 Answers: • Rectangular

 57. How can you restrict the delivery of multi-touch events to their subviews
 Answers: • By overriding hitTest:withEvent:

 58. Using the following function, what will you get from the default database?

 NSUserDefaults* defs = [NSUserDefaults standardUserDefaults];
 NSArray* languages = [defs objectForKey:@"AppleLanguages"];
 NSString* preferredLang = [languages objectAtIndex:0];
 Answers: • The user's preferred language.

 59. Which of the following should be used to draw 3D content?
 Answers: • OpenGL ES

 60. Which of the following is a feature of CAPropertyAnimation class in Core Animation?
 Answers: • It is an abstract subclass that provides support for animating a layer property specified by a key path

 61. While recording a sound, how can you know if the source of the sound is from the built-in microphone or headphone microphone?
 Answers: • iPhone OS 2.1 version does not support sound recording.

 62. Can non-main threads poll for events?
 Answers: • Yes

 63. What can trigger a call to touchesCancelled:withEvent: ?
 Answers: • A system event, such as a phone call

 64. In which of the following classes are the addChild, insertChild, and removeChildAtIndex methods defined?
 Answers: • NSXMLElement Class

 65. While opening Nib files, which of the following should not be ignored?
 Answers: • If Objects in a Nib file have broken connections, they should not be restored.

 66. What does CFSocketGetNative return?
 Answers: • A POSIX socket handle

 67. Are instances of ABAddressBookRef thread safe?
 Answers: • Yes

 68. Which of the following best describes View Controllers?
 Answers: • View Controllers provide the basic user interface logic for presenting numerous application views to the user.

 69. Is NSRunLoop thread safe?
 Answers: • No

 70. What is the default value for the anchorPoint property in Layer Geometry?
 Answers: • (0.5,0.5)

 71. Can the iPhone use Bonjour messaging?
 Answers: • Yes

 72. Which of the following debugging tasks are provided by Xcode to find and squash bugs in your code?
 Answers: • All of the above

 73. If the code is written using the Core Foundation and Foundation macros, the simplest way to create strings files is:
 Answers: • By using the genstrings command-line tool.

 74. Which type of data is returned by the following function?

 CFDataRef CreateDataFromImage(UIImage *image)

 {
 return CGDataProviderCopyData(CGImageGetDataProvider(image.CGImage));
 }
 Answers: • Raw pixel data.

 75. How can you play video on the iPhone from your application?
 Answers: • With the MediaPlayer framework

 76. If you try to run an application in the iPhone Simulator without having created the ControllerView Nib file, what will happen?
 Answers: • If you set the Nib file name to nil using initWithNibName:nil, the application will run

 77. Which design pattern for your application periodically sends messages to another object to ask for input or to notify that an event is occurring?
 Answers: • Delegation

 78. Choose the correct statement:
 To "flip" your user interface:
 Answers: • use the setAnimationTransition:forView:Cache: method of the UIView class, and provide the appropriate constant to specify the flip direction.

 79. What is the default setting to refer to file locations in your Xcode project?
 Answers: • Relative to Enclosing Group

 80. How can you create an OpenGL ES texture with a .png image?
 Answers: • Using CGContextDrawImage in a CGBitmapContext

 81. By which of the following methods can an NSAutoreleasePool object be created?
 Answers: • autorelease

 82. Is OpenAL available on the iPhone?
 Answers: • Yes

 83. What are universal binaries in Xcode?
 Answers: • These are executable files that can contain code and data for more than one architecture.

 84. The most effective way to ensure that users have a positive application-switching experience is to _______.
 Answers: • pare the launch time of the application to the minimum

 85. Which of the following classes will be used to embbed web content in an iPhone application?
 Answers: • UIWebView

 86. Are multiple touches enabled by default?
 Answers: • No

 87. Can your application change the global sound volume?
 Answers: • No

 88. Which of the following statement is incorrect with regard to Object Ownership in Memory Management?
 Answers: • If an object is copied, the retain count is returned as 0

No comments:

Post a Comment