Upwork Test Answers of iPhone Programming OS 2.1 Test Part 02
Question: 46
Which of the following need to be modified while localizing an application?
a. Nib files (windows, views, menus).
b. Static text.
c. Icons and graphics.
d. Dynamic text generated by your program.
Answer: a., b., c. and d.


Question: 47
Are multiple touches enabled by default?
a. Yes
b. No
Answer: b. No


Question: 48
Which of the following SDK classes can be used to get the location of the movement of a finger on the iPhone screen?
a. UINavigationController
b. UIEvent
c. UITouch
d. UIView
Answer: c. UITouch


Question: 49
Which of the following terms are related to Memory Management in Objective-C?
a. alloc
b. mutableCopy
c. delete
d. release
Answer: a., b. and d.


Question: 50
Which of the following classes will be used to embbed web content in an iPhone application?
a. UIWebView
b. UIViewController
c. UINavigationController
d. UITabBarController
Answer: a. UIWebView


Question: 51
Which design pattern for your application periodically sends messages to another object to ask for input or to notify that an event is occurring?
a. Model-View-Controller
b. Delegation
c. Target-action
Answer: b. Delegation


Question: 52
What is the endianness of the network for IP communications?
a. Big endian
b. Little endian
c. Mixed endian
d. Swapped endian
e. Single endian
Answer: a. Big endian


Question: 53
If the code is written using the Core Foundation and Foundation macros, the simplest way to create strings files is:
a. Using an option in the Preferences panel of Interface Builder.
b. By merging the comments from the individual entries into one comment string.
c. By unlocking all connections.
d. By using the genstrings command-line tool.
Answer: d. By using the genstrings command-line tool.


Question: 54
Which of the following is the correct syntax for declaring a class in Objective-C?
a. @interface ClassName : ItsSuperclass
    {
            instance variable declarations
    }
    method declarations
    @end
b. @implementation ClassName : ItsSuperclass
    {
            instance variable declarations
    }
    method declarations
    @end
c. @class ClassName : ItsSuperclass
    {
            instance variable declarations
    }
    method declarations
    @end
d. All are correct
Answer: a. @interface ClassName : ItsSuperclass
    {
            instance variable declarations
    }
    method declarations
    @end


Question: 55
Can you use POSIX threads on the iPhone?
a. Yes
b. No
Answer: a. Yes


Question: 56
Which of the following events occur when the retain count of the object drops to 0?
a. The release method is fired to relinquish the ownership of the object.
b. The object is deallocated.
c. The dealloc method is invoked automatically
d. The resources associated with it are disposed
Answer: a. The release method is fired to relinquish the ownership of the object.
                d. The resources associated with it are disposed


Question: 57
Choose the correct statement: To "flip" your user interface:
a. use the standardViewTransition:forInterface:Cache: method of the UIView class, and provide the appropriate constant to specify the flip direction.
b. use the setAnimationTransition:forView:Cache: method of the UIView class, and provide the appropriate constant to specify the flip direction.
c. use the setUICatalog:forView:Cache: method of the UIView class reference, and provide the appropriate constant to specify the flip direction.
d. The user interface can not be flipped
Answer: a. use the standardViewTransition:forInterface:Cache: method of the UIView class, and provide the appropriate constant to specify the flip direction.


Question: 58
Which of the following classes is used to internalize an XML into a logical tree structure?
a. NSData class
b. NSXMLDocument class
c. NSXMLNode class
d. NSPropertyListSerialization class
Answer: b. NSXMLDocument class


Question: 59
Which of the following debugging environments are provided by Xcode to find and squash bugs in your code?
a. Debugging from the text editor
b. Mini Debugger
c. Debugger window
d. GDB debugger console
e. All of the above
Answer: a. Debugging from the text editor


Question: 60
What does CFSocketGetNative return?
a. A CF opaque type
b. A POSIX socket handle
c. A native Cocoa object
d. A binary representation of the socket incoming data in machine native endian
e. None of the above
Answer: e. None of the above


Question: 61
Can your application change the global sound volume?
a. Yes
b. No
Answer: a. Yes


Question: 62
Locking all connections before editing the Nib files can be achieved by using:
a. An option in the Start Menu.
b. An option in the Preferences panel of Interface Builder.
c. An option in the Preferences panel of Language Directory.
d. Any of the above.
Answer: b. An option in the Preferences panel of Interface Builder.


Question: 63
Can non-main threads poll for events?
a. Yes
b. No
Answer: a. Yes


Question: 64
Which of the following languages can be used to write the code for Xcode projects?
a. C
b. C++
c. Objective-C
d. Objective-C++
e. Java
Answer: a., b., c. and d.


Question: 65
If you try to run an application in the iPhone Simulator without having created the ControllerView Nib file, what will happen?
a. The application will crash
b. The application will run smoothly
c. If you set the Nib file name to nil using initWithNibName:nil, the application will run
d. The application will take time to load
Answer: a., c. and d.


Question: 66
Is NSMutableArray thread safe?
a. Yes
b. No
Answer: b. No


Question: 67
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];

a. The list of preferred languages.
b. The user's preferred language.
c. The user's default language.
d. The list of languages supported by the application.
Answer: c. The user's default language.


Question: 68
The UIView class provides a function called setAlpha which adjusts the transparency of a view. Which of the following are valid code snippets with regard to setting transparency of a view? It is provided that appView is an object of UIView class.
a. [ appView setAlpha: 0.5 ];
b. [ appView setAlpha: 0.6 ];
c. [ appView setAlpha: 1.5 ];
d. [ appView setAlpha: 1 ];
Answer: a., b. and d.


Question: 69
Which of the following debugging tasks are provided by Xcode to find and squash bugs in your code? 
a. Add and set breakpoints.
b. View your call stack per thread.
c. View the value of variables by hovering the mouse pointer over them.
d. Execute a single line of code.
e. All of the above
Answer: c. View the value of variables by hovering the mouse pointer over them.


Question: 70
What is the function of the Code Sense feature in Xcode?
a. Code Sense helps in switching between different circumstances such as development or release.
b. Code Sense maintains an index that contains important information for your project.
c. Code Sense creates a cache for the files which are being used frequently.
d. Code Sense maintains an index of files used in a project.
Answer: d. Code Sense maintains an index of files used in a project.


Question: 71
Which type of data is returned by the following function?

   CFDataRef CreateDataFromImage(UIImage *image)
{
    return CGDataProviderCopyData(CGImageGetDataProvider(image.CGImage));
}
a. Binary image data.
b. Raw pixel data.
c. Compressed image data.
d. ASCII image data.
Answer: b. Raw pixel data.


Question: 72
Can you play two MP3 sound file at the same time on the iPhone?
a. Yes
b. No
Answer: a. Yes


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


Question: 74
Which of the following are the Derivative types defined in Objective-C?
a. short
b. long
c. long long
d. int
Answer: a., b. and c.


Question: 75
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?
a. The user should be asked to click save and close from the start menu
b. The user should be asked to close your application
c. The application should be programmed to save any user changes as they are made as quickly as possible.
d. No specific consideration in this regard is necessary
Answer: c. The application should be programmed to save any user changes as they are made as quickly as possible.


Question: 76
Which of the following is the base class for all iPhone applications?
a. UIActionSheet
b. UIApplication
c. UIControl
d. UIApplicationDelegate
Answer: b. UIApplication


Question: 77
How can you prevent a view from receiving touch events?
a. By overriding UIResponder relevant methods
b. By setting userInteractionEnabled to false
c. By setting shouldDeliverEvent to false
d. You can't
e. None of the above
Answer: b. By setting userInteractionEnabled to false


Question: 78
Is NSRunLoop thread safe?
a. Yes
b. No
Answer: ----


Question: 79
What is the default setting to refer to file locations in your Xcode project?
a. Relative to Build Product
b. Relative to Project
c. Relative to Enclosing Group
d. Relative to
e. Absolute Path
Answer: ----


Question: 80
Can CGGradientRef be used on the iPhone to draw gradients?
a. Yes
b. No
Answer: ----


Question: 81
By which of the following methods can an NSAutoreleasePool object be created?
a. autorelease
b. alloc
c. copy
d. retain
Answer: a. autorelease


Question: 82
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?
a. It positions the content image in the top left corner of the layer.
b. It positions the content image vertically centered on the left edge of the layer.
c. It positions the content image in the bottom left corner of the layer.
d. It positions the content image at the center of the layer.
Answer: a. It positions the content image in the top left corner of the layer.


Question: 83
If you want to know if a host is reachable via the network, what would you use in your application?
a. ping
b. NSURL isReachable: method
c. NSNetwork discover: method
d. SCNetworkReachabilityCreateWithName
e. None of the above
Answer: ----


Question: 84
Can the iPhone use Bonjour messaging?
a.Yes
b.No
Answer: ----


Question: 85
Which of the following can be used to draw a tiled image?
a. Quartz 2D function CGContextDrawTiledImage
b. UIViews
c. Either a or b
d. Neither a not b
Answer: ----


Question: 86
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?

a. To release the instance variables
b. To conform to the rules of memory management
c. To make the variables available for reuse in application
d. To terminate the program
Answer: a., b. and c.


Question: 87
Which of the following are valid touch attributes in a UITouch class object?
a. locationInView
b. timestamp
c. phase
d. tapCount
Answer: b., c. and d.


Question: 88
What is the default setting to refer to file locations in your Xcode project?
a. Relative to Build Product
b. Relative to Project
c. Relative to Enclosing Group
d. Relative to <source path>
e. Absolute Path
Answer: ----


Question: 89
In which of the following classes are the addChild, insertChild, and removeChildAtIndex methods defined?
a. NSXMLElement Class
b. NSXMLNode Class
c. NSXMLDocument class
d. NSPropertyListSerialization class
Answer: ----


Question: 90
Before editing the Nibs, one should:
a. Unlock all connections.
b. Lock all connections.
c. Break all connections.
d. None of the above
Answer: ----


Question: 91
How do you play a short sound on the iPhone?
a. With the NSSound class
b. With the UISound class
c. With AudioServicesPlaySystemSound function
d. With NSSystemSound function
e. None of the above
Answer: ----


Question: 92
Can you use POSIX sockets on the iPhone?
a.Yes
b.No
Answer: a.Yes

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

Don't Miss A Single Updates

Remember to check your email account to confirm your subscription.

Blogger
Disqus
Post a comment ➜

No Comment