Upwork IPHONE PROGRAMMING OS 2.1 TEST 2016

Hello Freelancer, Welcome to allupworktestanswers.com Here to get the IPHONE PROGRAMMING OS 2.1 TEST of Latest version 2016. We are ready here to provide your desire upwork test answer. We already tested all exam test information Available include on here. So Dear, Why Late? Read the below full exam test and get more information from our website.

Upwork IPHONE PROGRAMMING OS 2.1 TEST 2016

1. Which of the following languages can be used to write the code for Xcode projects?

Answers:
  1. C
  2. C++
  3. Objective-C
  4. Objective-C++
  5. Java
2. Which of the following need to be modified while localizing an application?
Answers:
  1. Nib files (windows, views, menus).
  2. Static text.
  3. Icons and graphics.
  4. Dynamic text generated by your program.
3. Which of the following directives are used to declare and define classes, categories, and protocols?
Answers:
  1. @interface
  2. @implementation
  3. @protocol
  4. @class
  5. @end
4. Which of the following statements regarding Objective-C are correct?
Answers:
  1. In Objective-C, the keyword for NULL is nil.
  2. In Objective-C, #import and #include compiler directives carry out the same operations.
  3. In Objective-C, for the object-oriented constructs (such as method return values), id is the default data type.
  4. 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:
  1. locationInView
  2. timestamp
  3. phase
  4. tapCount
6. Which of the following statements comply with the fundamental rules of Memory Management in Objective-C?
Answers:
  1. 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.
  2. The ownership of the objects is relinquished by using release or autorelease
  3. All other objects can also be released from memory using the release function.
  4. autorelease just means – send a release message later
7. The genstrings tool can parse _____.
Answers:
  1. C files with .c filename extension.
  2. Objective-C files with .m filename extension.
  3. Java code files with .java filename extension.
  4. Nib files with any file name extension.
8. Which of the following are the Derivative types defined in Objective-C?
Answers:
  1. short
  2. long
  3. long long
  4. int
9. Which of the following options regarding UIWindow and UIView classes are correct?
Answers:
  1. A UIWindow class object holds the contents of a UIView class object.
  2. A UIWindow class object can hold multiple sub-objects whereas a UIView class object can hold only one sub-object.
  3. Both UIWindow and UIView classes are required to display anything on the iPhone.
  4. 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:
  1. The alloc method creates a new object and returns it with a reference count of 1
  2. retain does not change the receiver’s reference count
  3. release decreases the receiver’s reference count by 1
  4. autorelease decreases the receiver’s reference count by 1 at some point in the future
  5. copy makes a copy of an object and increases the reference count by 1
11. Which of the following events occur when the retain count of the object drops to 0?
Answers:
  1. The release method is fired to relinquish the ownership of the object.
  2. The object is deallocated.
  3. The dealloc method is invoked automatically
  4. The resources associated with it are disposed
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:
  1. UINavigationController
  2. UIEvent
  3. UITouch
  4. UIView
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:
  1. To release the instance variables
  2. To conform to the rules of memory management
  3. To make the variables available for reuse in application
  4. To terminate the program
14. Which of the following terms are related to Memory Management in Objective-C?
Answers:
  1. alloc
  2. mutableCopy
  3. delete
  4. 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:
  1. [ actionuser setActionSheetStyle: 0 ];
  2. [ actionuser setActionSheetStyle: 1 ];
  3. [ actionuser setActionSheetStyle: 2 ];
  4. [ actionuser setActionSheetStyle: 3 ];
16. Is NSMutableArray thread safe?
Answers:
  1. Yes
  2. No
17. What is the purpose of active executable in an Xcode project?
Answers:
  1. To specify which program is launched and how, when you run or debug from within Xcode.
  2. To select the appropriate configuration of the active target and each target it depends upon while building.
  3. To define different build configurations for different circumstances such as development or release.
  4. To build products for Multiple Platforms.
18. Which of the following samples returns the first name of a person listed under p in the address book?
Answers:
  1. ABPersonGetValue(p, kABFirstNameProperty);
  2. ABPersonCopyValue(p, kABFirstNameProperty);
  3. ABRecordGetValue(p, kABPersonFirstNameProperty);
  4. ABRecordCopyValue(p, kABPersonFirstNameProperty);
  5. [p firstName];
19. In which file is the following function called in your application?
int retVal = UIApplicationMain(argc, argv, nil, nil);
Answers:
  1. info.plist
  2. Any file with .m extension
  3. main.m only
  4. Any file with .h extension
  5. ControllerView file
  6. Nib file
20. State whether the following statement is true or false:
Interface Builder doesn’t generate source code
Answers:
  1. True
  2. False
21. Can you place calls using the iPhone SDK?
Answers:
  1. Yes
  2. No
22. Can you use POSIX threads on the iPhone?
Answers:
  1. Yes
  2. No
23. Which of the following is the correct syntax for declaring a class in Objective-C?
Answers:
  1. @interface ClassName : ItsSuperclass { instance variable declarations } method declarations @end
  2. @implementation ClassName : ItsSuperclass { instance variable declarations } method declarations @end
  3. @class ClassName : ItsSuperclass { instance variable declarations } method declarations @end
  4. All are correct
24. Locking all connections before editing the Nib files can be achieved by using:
Answers:
  1. An option in the Start Menu.
  2. An option in the Preferences panel of Interface Builder.
  3. An option in the Preferences panel of Language Directory.
  4. Any of the above.
25. What is the endianness of the network for IP communications?
Answers:
  1. Big endian
  2. Little endian
  3. Mixed endian
  4. Swapped endian
  5. Single endian
26. What is the screen resolution of the iPhone 3G?
Answers:
  1. 720×540
  2. 480×320
  3. 320×240
  4. 540×280
  5. 540×480
27. Which of the following methods does the UIKit provide in order to draw a string at a specific point.
Answers:
  1. NSString
  2. drawAtPoint:
  3. drawAsPatternInRect
  4. All of the above
28. From which of the following classes does a UITextView class object inherit its features?
Answers:
  1. UIScroller
  2. UIView
  3. UIControl
  4. UITextField
29. Which of the following can be used to draw a tiled image?
Answers:
  1. Quartz 2D function CGContextDrawTiledImage
  2. UIViews
  3. Either a or b
  4. Neither a not b
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:
  1. [ dateModePicker setDatePickerMode: 0 ];
  2. [ dateModePicker setDatePickerMode: 1 ];
  3. [ dateModePicker setDatePickerMode: 2 ];
  4. [ dateModePicker setDatePickerMode: 3 ];
31. Which of the following is the base class for all iPhone applications?
Answers:
  1. UIActionSheet
  2. UIApplication
  3. UIControl
  4. UIApplicationDelegate
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:
  1. It positions the content image in the top left corner of the layer.
  2. It positions the content image vertically centered on the left edge of the layer.
  3. It positions the content image in the bottom left corner of the layer.
  4. It positions the content image at the center of the layer.
33. Before editing the Nibs, one should:
Answers:
  1. Unlock all connections.
  2. Lock all connections.
  3. Break all connections.
  4. None of the above
34. Given the string “192.168.1.1”, how can you get an integer address (to fill a sockaddr_in structure)?
Answers:
  1. With inet_ntoa
  2. With inet_aton
  3. With NSString
  4. All addresses are in ASCII format
  5. None of the above
35. Can you use POSIX sockets on the iPhone?
Answers:
  1. Yes
  2. No
36. If you want to know if a host is reachable via the network, what would you use in your application?
Answers:
  1. ping
  2. NSURL isReachable: method
  3. NSNetwork discover: method
  4. SCNetworkReachabilityCreateWithName
  5. None of the above
37. What happens if Xcode is not able to find a file or folder at the path defined for it in the project?
Answers:
  1. Xcode skips the file or the folder and continues execution.
  2. Xcode gives an alert with a description of the missing file.
  3. Xcode displays the item in red in the project window.
38. In which language is the address book framework written?
Answers:
  1. Objective-C
  2. C
  3. C++
  4. Ruby
  5. Java
39. When the genstrings tool discovers a key string used more than once in a single strings file, it:
Answers:
  1. deletes the comments from the individual entries and leaves one comment string without generating a warning.
  2. merges the comments from the individual entries into one comment string and generates a warning.
  3. differentiates the comments from the individual entries into various strings and generates a warning.
  4. None of the above
40. Which of the following classes is used to internalize an XML into a logical tree structure?
Answers:
  1. NSData class
  2. NSXMLDocument class
  3. NSXMLNode class
  4. NSPropertyListSerialization class
41. What is the CompressResources build step in an iPhone Xcode project?
Answers:
  1. It resizes all the files in the project for displaying them in the iPhone.
  2. It resizes the png files in the project for displaying them in the iPhone.
  3. It compresses the files with the extensions .m and .h.
  4. It changes the extension of the files and compresses them.
42. Can CGGradientRef be used on the iPhone to draw gradients?
Answers:
  1. Yes
  2. No
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:
  1. The user should be asked to click save and close from the start menu
  2. The user should be asked to close your application
  3. The application should be programmed to save any user changes as they are made as quickly as possible.
  4. No specific consideration in this regard is necessary
44. Which of the following debugging environments are provided by Xcode to find and squash bugs in your code?
Answers:
  1. Debugging from the text editor
  2. Mini Debugger
  3. Debugger window
  4. GDB debugger console
  5. All of the above
45. On the iPhone, what are the types of Person entries and Group entries?
Answers:
  1. ABPersonRef and ABGroupRef
  2. ABPerson and ABGroup
  3. ABRecordRef and ABRecordRef
  4. ABRecord and ABRecord
  5. None of the above
46. How do you play a short sound on the iPhone?
Answers:
  1. With the NSSound class
  2. With the UISound class
  3. With AudioServicesPlaySystemSound function
  4. With NSSystemSound function
  5. None of the above
47. What is the function of the Code Sense feature in Xcode?
Answers:
  1. Code Sense helps in switching between different circumstances such as development or release.
  2. Code Sense maintains an index that contains important information for your project.
  3. Code Sense creates a cache for the files which are being used frequently.
  4. Code Sense maintains an index of files used in a 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:
  1. quits
  2. keeps running
  3. resumes as soon as the other application is terminated
  4. may or may not resume depending on the application
49. Does ABPersonCreate function add the newly created record into the address book?
Answers:
  1. Yes
  2. No
50. How can you prevent a view from receiving touch events?
Answers:
  1. By overriding UIResponder relevant methods
  2. By setting userInteractionEnabled to false
  3. By setting shouldDeliverEvent to false
  4. You can’t
  5. None of the above
51. Which of the following is true?
Answers:
  1. An application thread can have only one NSAutoreleasePool
  2. NSAutoreleasePool is thread safe
  3. NSAutoreleasePool should not be used outside the main thread
  4. Each thread maintains its own stack of NSAutoreleasePool objects
  5. None is true
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:
  1. A
  2. B
  3. C
  4. None of the above
53. Which of the following classes automatically manages transition
animation between Views?
Answers:
  1. UIAnimationController
  2. UIViewAnimation
  3. CGViewAnimation
  4. UIApplicationDelegate
  5. UINavigationController
54. Which of the following is not a touch event method?
Answers:
  1. – (void)touchesDragged:(NSSet *)touches withEvent:(UIEvent *)event;
  2. – (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
  3. – (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
  4. – (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
  5. – (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
55. How many windows does an iPhone application typically have?
Answers:
  1. 0
  2. 1
  3. 2
  4. 10
  5. None of the above
56. Which of the following shapes is generated by Views in an iPhone?
Answers:
  1. Rectangular
  2. Square
  3. Rhombus
  4. All of the above
57. How can you restrict the delivery of multi-touch events to their subviews
Answers:
  1. You can’t
  2. By manually redirecting events from the event handlers
  3. By overriding hitTest:withEvent:
  4. By registering the subview in the notification center
  5. None of the above
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:
  1. The list of preferred languages.
  2. The user’s preferred language.
  3. The user’s default language.
  4. The list of languages supported by the application.
59. Which of the following should be used to draw 3D content?
Answers:
  1. OpenGL
  2. OpenGL ES
  3. Direct 3D
  4. None of the above
60. Which of the following is a feature of CAPropertyAnimation class in Core Animation?
Answers:
  1. It is an abstract subclass that provides support for animating a layer property specified by a key path
  2. It allows an array of animation objects to be grouped together and run concurrently
  3. It provides simple interpolation for a layer property
  4. It provides a transition effect that affects the entire layer’s content. It fades, pushes, or reveals layer content when animating
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:
  1. With the NSSound class method named audioSource
  2. With the AudioQueueGetParameters function
  3. By querying the registry
  4. By polling for audio events
  5. iPhone OS 2.1 version does not support sound recording.
62. Can non-main threads poll for events?
Answers:
  1. Yes
  2. No
63. What can trigger a call to touchesCancelled:withEvent: ?
Answers:
  1. The user lifting all fingers from the phone
  2. A system event, such as a phone call
  3. The user lifting one or more fingers from the phone
  4. This method doesn’t exist
  5. None of the above
64. In which of the following classes are the addChild, insertChild, and removeChildAtIndex methods defined?
Answers:
  1. NSXMLElement Class
  2. NSXMLNode Class
  3. NSXMLDocument class
  4. NSPropertyListSerialization class
65. While opening Nib files, which of the following should not be ignored?
Answers:
  1. Objects in a Nib file typically have connections between them that should not be broken.
  2. If Objects in a Nib file have broken connections, they should not be restored.
  3. The size of the files.
  4. None of the above
66. What does CFSocketGetNative return?
Answers:
  1. A CF opaque type
  2. A POSIX socket handle
  3. A native Cocoa object
  4. A binary representation of the socket incoming data in machine native endian
  5. None of the above
67. Are instances of ABAddressBookRef thread safe?
Answers:
  1. Yes
  2. No
68. Which of the following best describes View Controllers?
Answers:
  1. View Controllers provide access to data.
  2. View Controllers implement Views’ inner logic.
  3. View Controllers regulate Views’ animations.
  4. View Controllers provide the basic user interface logic for presenting numerous application views to the user.
  5. None of the above
69. Is NSRunLoop thread safe?
Answers:
  1. Yes
  2. No
70. What is the default value for the anchorPoint property in Layer Geometry?
Answers:
  1. (0.0,0.0)
  2. (0.0,0.5)
  3. (0.5,0.0)
  4. (0.5,0.5)
  5. (1.0,1.0)
71. Can the iPhone use Bonjour messaging?
Answers:
  1. Yes
  2. No
72. Which of the following debugging tasks are provided by Xcode to find and squash bugs in your code?
Answers:
  1. Add and set breakpoints.
  2. View your call stack per thread.
  3. View the value of variables by hovering the mouse pointer over them.
  4. Execute a single line of code.
  5. 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:
  1. Using an option in the Preferences panel of Interface Builder.
  2. By merging the comments from the individual entries into one comment string.
  3. By unlocking all connections.
  4. 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:
  1. Binary image data.
  2. Raw pixel data.
  3. Compressed image data.
  4. ASCII image data.
75. How can you play video on the iPhone from your application?
Answers:
  1. With QuickTime
  2. With OpenGL ES
  3. With the MediaPlayer framework
  4. With VideoCodecServices
76. If you try to run an application in the iPhone Simulator without having created the ControllerView Nib file, what will happen?
Answers:
  1. The application will crash
  2. The application will run smoothly
  3. If you set the Nib file name to nil using initWithNibName:nil, the application will run
  4. The application will take time to load
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:
  1. Model-View-Controller
  2. Delegation
  3. Target-action
78. Choose the correct statement:
To “flip” your user interface:
Answers:
  1. use the standardViewTransition:forInterface:Cache: method of the UIView class, and provide the appropriate constant to specify the flip direction.
  2. use the setAnimationTransition:forView:Cache: method of the UIView class, and provide the appropriate constant to specify the flip direction.
  3. use the setUICatalog:forView:Cache: method of the UIView class reference, and provide the appropriate constant to specify the flip direction.
  4. The user interface can not be flipped
79. What is the default setting to refer to file locations in your Xcode project?
Answers:
  1. Relative to Build Product
  2. Relative to Project
  3. Relative to Enclosing Group
  4. Relative to <source path>
  5. Absolute Path
80. How can you create an OpenGL ES texture with a .png image?
Answers:
  1. Using UIImage glTexture property
  2. Using UIImageBitmapRep
  3. Using CGContextDrawImage in a CGBitmapContext
  4. You can’t
  5. None of the above
81. By which of the following methods can an NSAutoreleasePool object be created?
Answers:
  1. autorelease
  2. alloc
  3. copy
  4. retain
82. Is OpenAL available on the iPhone?
Answers:
  1. Yes
  2. No
83. What are universal binaries in Xcode?
Answers:
  1. These are executable files that can contain code and data for more than one architecture.
  2. These are file references which are generated by the target, such as an application.
  3. These are indexes that contain symbolic information for your project.
  4. These are used to specify build location settings.
84. The most effective way to ensure that users have a positive application-switching experience is to _______.
Answers:
  1. enhance the launch time of the application to the maximum
  2. reduce the memory space allocated to all applications
  3. pare the launch time of the application to the minimum
  4. disable any unused applications
85. Which of the following classes will be used to embbed web content in an iPhone application?
Answers:
  1. UIWebView
  2. UIViewController
  3. UINavigationController
  4. UITabBarController
86. Are multiple touches enabled by default?
Answers:
  1. Yes
  2. No
87. Can your application change the global sound volume?
Answers:
  1. Yes
  2. No
88. Which of the following statement is incorrect with regard to Object Ownership in Memory Management?
Answers:
  1. An object may have one or more owners
  2. An object is owned by the user if it is created using alloc
  3. If an object is copied, the retain count is returned as 0
  4. If an object has no owners, its retain count drops to 0


Finally no more words require about the IPHONE PROGRAMMING OS 2.1 TEST  information in this session of this content. If you are require knowing more, Please ask to us via our contact us form or comment box. Please make sure that, you don’t send Personal information via the Comment box.  Thank you very mutch for being with us.

0 comments: