Upwork Test Answers of iPhone Programming OS 2.1 Test Part 01Question: 01
Whenever the iPhone users switch to another application like answering the phone, or checking their email, the application they were previously using __________?

a. quits
b. keeps running
c. resumes as soon as the other application is terminated
d. may or may not resume depending on the application
Answer: c. resumes as soon as the other application is terminated


Question: 02
Is OpenAL available on the iPhone?
a. Yes
b. No
Answer: a. Yes


Question: 03
Which of the following is a feature of CAPropertyAnimation class in Core Animation?
a. It is an abstract subclass that provides support for animating a layer property specified by a key path
b. It allows an array of animation objects to be grouped together and run concurrently
c. It provides simple interpolation for a layer property
d. It provides a transition effect that affects the entire layer's content. It fades, pushes, or reveals layer content when animating
Answer: a. It is an abstract subclass that provides support for animating a layer property specified by a key path


Question: 04
How can you play video on the iPhone from your application?
a. With QuickTime
b. With OpenGL ES
c. With the MediaPlayer framework
d. With VideoCodecServices
Answer: c. With the MediaPlayer framework


Question: 05
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?
a. [ dateModePicker setDatePickerMode: 0 ];
b. [ dateModePicker setDatePickerMode: 1 ];
c. [ dateModePicker setDatePickerMode: 2 ];
d. [ dateModePicker setDatePickerMode: 3 ];
Answer: b. [ dateModePicker setDatePickerMode: 1 ];


Question: 06
What happens if Xcode is not able to find a file or folder at the path defined for it in the project?
a. Xcode skips the file or the folder and continues execution.
b. Xcode gives an alert with a description of the missing file.
c. Xcode displays the item in red in the project window.
Answer: a. Xcode skips the file or the folder and continues execution.


Question: 07
Does ABPersonCreate function add the newly created record into the address book?
a. Yes
b. No
Answer: a. Yes


Question: 08
Can you place calls using the iPhone SDK?
a. Yes
b. No
Answer: a. Yes


Question: 09
Which of the following statements regarding Objective-C are correct?
a. In Objective-C, the keyword for NULL is nil.
b. In Objective-C, #import and #include compiler directives carry out the same operations.
c. In Objective-C, for the object-oriented constructs (such as method return values), id is the default data type.
d. The keyword nil has an id with a value of 0.
Answer: a., b., c. and d.


Question: 11
While recording a sound, how can you know if the source of the sound is from the built-in microphone or headphone microphone?
a. With the NSSound class method named audioSource
b. With the AudioQueueGetParameters function
c. By querying the registry
d. By polling for audio events
e. iPhone OS 2.1 version does not support sound recording.
Answer: b. With the AudioQueueGetParameters function


Question: 12
What can trigger a call to touchesCancelled:withEvent: ?
a. The user lifting all fingers from the phone
b. A system event, such as a phone call
c. The user lifting one or more fingers from the phone
d. This method doesn't exist
e. None of the above
Answer: a. The user lifting all fingers from the phone


Question: 13
What kinds of current device orientations are provided by the UIDevice class?
a. orientation
b. generatesDeviceOrientationNotifications
c. beginGeneratingDeviceOrientationNotifications
d. uniqueIdentifier
Answer: a., b., and c.


Question: 14
Which of the following samples returns the first name of a person listed under p in the address book?
a. ABPersonGetValue(p, kABFirstNameProperty);
b. ABPersonCopyValue(p, kABFirstNameProperty);
c. ABRecordGetValue(p, kABPersonFirstNameProperty);
d. ABRecordCopyValue(p, kABPersonFirstNameProperty);
e. [p firstName];
Answer: d. ABRecordCopyValue(p, kABPersonFirstNameProperty);


Question: 15
What is the screen resolution of the iPhone 3G?
a. 720x540
b. 480x320
c. 320x240
d. 540x280
e. 540x480
Answer: b. 480x320


Question: 16
When the genstrings tool discovers a key string used more than once in a single strings file, it?
a. deletes the comments from the individual entries and leaves one comment string without generating a warning.
b. merges the comments from the individual entries into one comment string and generates a warning.
c. differentiates the comments from the individual entries into various strings and generates a warning.
d. None of the above
Answer: b. merges the comments from the individual entries into one comment string and generates a warning.


Question: 17
How many windows does an iPhone application typically have?
a. 0
b. 1
c. 2
d. 10
e. None of the above
Answer: b. 1


Question: 18
State whether the following statement is true or false:
Interface Builder doesn't generate source code
a. True
b. False
Answer: b. False


Question: 19
While opening Nib files, which of the following should not be ignored?
a. Objects in a Nib file typically have connections between them that should not be broken.
b. If Objects in a Nib file have broken connections, they should not be restored.
c. The size of the files.
d. None of the above
Answer: b. If Objects in a Nib file have broken connections, they should not be restored.


Question: 20
In which file is the following function called in your application?
int retVal = UIApplicationMain(argc, argv, nil, nil);
a. info.plist
b. Any file with .m extension
c. main.m only
d. Any file with .h extension
e. ControllerView file
f. Nib file
Answer: c. main.m only


Question: 21
Which of the following options regarding UIWindow and UIView classes are correct?
a. A UIWindow class object holds the contents of a UIView class object.
b. A UIWindow class object can hold multiple sub-objects whereas a UIView class object can hold only one sub-object.
c. Both UIWindow and UIView classes are required to display anything on the iPhone.
d. UIWindow is the iPhone's base window class and the UIView class is primarily an abstract super-class.
Answer: c. Both UIWindow and UIView classes are required to display anything on the iPhone.


Question: 22
Which of the following shapes is generated by Views in an iPhone?
a. Rectangular
b. Square
c. Rhombus
d. All of the above
Answer: d. All of the above


Question: 23
What is the purpose of active executable in an Xcode project?
a. To specify which program is launched and how, when you run or debug from within Xcode.
b. To select the appropriate configuration of the active target and each target it depends upon while building.
c. To define different build configurations for different circumstances such as development or release.
d. To build products for Multiple Platforms.
Answer: a. To specify which program is launched and how, when you run or debug from within Xcode.


Question: 24
Which of the following methods does the UIKit provide in order to draw a string at a specific point?
a. NSString
b. drawAtPoint:
c. drawAsPatternInRect
d. All of the above
Answer: b. drawAtPoint:


Question: 25
Which of the following directives are used to declare and define classes, categories, and protocols?
a. @interface
b. @implementation
c. @protocol
d. @class
e. @end
Answer: a., b., c. and e.


Question: 26
Which of the following best describes View Controllers?
a. View Controllers provide access to data.
b. View Controllers implement Views' inner logic.
c. View Controllers regulate Views' animations.
d. View Controllers provide the basic user interface logic for presenting numerous application views to the user.
e. None of the above
Answer: b. View Controllers implement Views' inner logic.


Question: 27
How can you restrict the delivery of multi-touch events to their subviews?
a. You can't
b. By manually redirecting events from the event handlers
c. By overriding hitTest:withEvent:
d. By registering the subview in the notification center
e. None of the above
Answer: c. By overriding hitTest:withEvent:


Question: 28
Which of the following is not a touch event method?
a. - (void)touchesDragged:(NSSet *)touches withEvent:(UIEvent *)event;
b. - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
c. - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
d. - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
e. - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
Answer: a. - (void)touchesDragged:(NSSet *)touches withEvent:(UIEvent *)event;


Question: 29
Which of the following should be used to draw 3D content?
a. OpenGL
b. OpenGL ES
c. Direct 3D
d. None of the above
Answer: b. OpenGL ES


Question: 30
Are instances of ABAddressBookRef thread safe?
a. Yes
b. No
Answer: a. Yes


Question: 31
What is the default value for the anchorPoint property in Layer Geometry?
a. (0.0,0.0)
b. (0.0,0.5)
c. (0.5,0.0)
d. (0.5,0.5)
e. (1.0,1.0)
Answer: d. (0.5,0.5)


Question: 32
In which language is the address book framework written?
a. Objective-C
b. C
c. C++
d. Ruby
e. Java
Answer: a. Objective-C


Question: 33
The most effective way to ensure that users have a positive application-switching experience is to ____________?
a. enhance the launch time of the application to the maximum
b. reduce the memory space allocated to all applications
c. pare the launch time of the application to the minimum
d. disable any unused applications
Answer: a. enhance the launch time of the application to the maximum


Question: 34
Which of the following statements regarding Memory Management are correct?
a. The alloc method creates a new object and returns it with a reference count of 1
b. retain does not change the receiver's reference count
c. release decreases the receiver's reference count by 1
d. autorelease decreases the receiver's reference count by 1 at some point in the future
e. copy makes a copy of an object and increases the reference count by 1
Answer: b. retain does not change the receiver's reference count


Question: 35
Which of the following statements comply with the fundamental rules of Memory Managementin Objective-C?
a. 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.
b. The ownership of the objects is relinquished by using release or autorelease
c. All other objects can also be released from memory using the release function.
d. autorelease just means - send a release message later
Answer: a. 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.


Question: 36
How can you create an OpenGL ES texture with a .png image?
a. Using UIImage glTexture property
b. Using UIImageBitmapRep
c. Using CGContextDrawImage in a CGBitmapContext
d. You can't
e. None of the above
Answer: c. Using CGContextDrawImage in a CGBitmapContext


Question: 37
The genstrings tool can parse __________?
a. C files with .c filename extension.
b. Objective-C files with .m filename extension.
c. Java code files with .java filename extension.
d. Nib files with any file name extension.
Answer: a., b. and c.


Question: 38
Which of the following is true?
a. An application thread can have only one NSAutoreleasePool
b. NSAutoreleasePool is thread safe
c. NSAutoreleasePool should not be used outside the main thread
d. Each thread maintains its own stack of NSAutoreleasePool objects
e. None is true
Answer: a. An application thread can have only one NSAutoreleasePool


Question: 39
Given the string "192.168.1.1", how can you get an integer address (to fill a sockaddr_in structure)?
a. With inet_ntoa
b. With inet_aton
c. With NSString
d. All addresses are in ASCII format
e. None of the above
Answer: d. All addresses are in ASCII format


Question: 40
What are universal binaries in Xcode?
a. These are executable files that can contain code and data for more than one architecture.
b. These are file references which are generated by the target, such as an application.
c. These are indexes that contain symbolic information for your project.
d. These are used to specify build location settings.
Answer: a. These are executable files that can contain code and data for more than one architecture.


Question: 41
On the iPhone, what are the types of Person entries and Group entries?
a. ABPersonRef and ABGroupRef
b. ABPerson and ABGroup
c. ABRecordRef and ABRecordRef
d. ABRecord and ABRecord
e. None of the above
Answer: c. ABRecordRef and ABRecordRef


Question: 42
Which of the following statement is incorrect with regard to Object Ownership in Memory Management?
a. An object may have one or more owners
b. An object is owned by the user if it is created using alloc
c. If an object is copied, the retain count is returned as 0
d. If an object has no owners, its retain count drops to 0
Answer: c. If an object is copied, the retain count is returned as 0


Question: 43
What is the CompressResources build step in an iPhone Xcode project?
a. It resizes all the files in the project for  displaying them in the iPhone.
b. It resizes the png files in the project for  displaying them in the iPhone.
c. It compresses the files with the extensions .m and .h.
d. It changes the extension of the files and compresses  them.
Answer: b. It resizes the png files in the project for  displaying them in the iPhone.


Question: 44
Which of the following classes automatically manages transition animation between Views?
a. UIAnimationController
b. UIViewAnimation
c. CGViewAnimation
d. UIApplicationDelegate
e. UINavigationController
Answer: e. UINavigationController


Question: 45
From which of the following classes does a UITextView class object inherit its features?
a. UIScroller
b. UIView
c. UIControl
d. UITextField
Answer: a. UIScroller and b. UIView

[ You may also see the second post for getting top score in Upwork exam >> Upwork Test Answer iPhone Programming OS 2.1 Test Part 02 ]

Don't Miss A Single Updates

Remember to check your email account to confirm your subscription.

Blogger
Disqus
Post a comment ➜

No Comment