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