Whenever the iPhoneusers 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
Is OpenAL available on the iPhone?
a. Yes
b. No
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
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
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 ];
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.
Does ABPersonCreate function add the newly created record into the address book?
a. Yes
b. No
Can you place calls using the iPhone SDK?
a. Yes
b. No
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.
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.
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
What kinds of current device orientations are provided by the UIDevice class?
a. orientation
b. generatesDeviceOrientationNotifications
c. beginGeneratingDeviceOrientationNotifications
d. uniqueIdentifier
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];
What is the screen resolution of the iPhone 3G?
a. 720x540
b. 480x320
c. 320x240
d. 540x280
e. 540x480
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
How many windows does an iPhone application typically have?
a. 0
b. 1
c. 2
d. 10
e. None of the above
State whether the following statement is true or false:
Interface Builder doesn't generate source code
Interface Builder doesn't generate source code
a. True
b. False
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
In which file is the following function called in your application?
int retVal = UIApplicationMain(argc, argv, nil, nil);
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
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.
Which of the following shapes is generated by Views in an iPhone?
a. Rectangular
b. Square
c. Rhombus
d. All of the above
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.
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
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
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
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
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
Which of the following should be used to draw 3D content?
a. OpenGL
b. OpenGL ES
c. Direct 3D
d. None of the above
Are instances of ABAddressBookRef thread safe?
a. Yes
b. No
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)
In which language is the address book framework written?
a. Objective-C
b. C
c. C++
d. Ruby
e. Java
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
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
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
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
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.
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
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
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.
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
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
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.
Which of the following classes automatically manages transition
animation between Views?
animation between Views?
a. UIAnimationController
b. UIViewAnimation
c. CGViewAnimation
d. UIApplicationDelegate
e. UINavigationController
From which of the following classes does a UITextView class object inherit its features?
a. UIScroller
b. UIView
c. UIControl
d. UITextField
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.
Are multiple touches enabled by default?
a. Yes
b. No
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
Which of the following terms are related to Memory Management in Objective-C?
a. alloc
b. mutableCopy
c. delete
d. release
Which of the following classes will be used to embbed web content in an iPhone application?
a. UIWebView
b. UIViewController
c. UINavigationController
d. UITabBarController
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
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
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.
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
{
instance variable declarations
}
method declarations
@end
b. @implementation ClassName : ItsSuperclass
{
instance variable declarations
}
method declarations
@end
{
instance variable declarations
}
method declarations
@end
c. @class ClassName : ItsSuperclass
{
instance variable declarations
}
method declarations
@end
{
instance variable declarations
}
method declarations
@end
d. All are correct
Can you use POSIX threads on the iPhone?
a. Yes
b. No
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
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
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
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
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
Can your application change the global sound volume?
a. Yes
b. No
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.
Can non-main threads poll for events?
a. Yes
b. No
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
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
Is NSMutableArray thread safe?
a. Yes
b. No
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];
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.
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 ];
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
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.
Which type of data is returned by the following function?
CFDataRef CreateDataFromImage(UIImage *image)
{
return CGDataProviderCopyData(CGImageGetDataProvider(image.CGImage));
}
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.
Can you play two MP3 sound file at the same time on the iPhone?
a. Yes
b. No
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 ];
Which of the following are the Derivative types defined in Objective-C?
a. short
b. long
c. long long
d. int
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
Which of the following is the base class for all iPhone applications?
a. UIActionSheet
b. UIApplication
c. UIControl
d. UIApplicationDelegate
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
Is NSRunLoop thread safe?
a. Yes
b. No
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
Can CGGradientRef be used on the iPhone to draw gradients?
a. Yes
b. No
By which of the following methods can an NSAutoreleasePool object be created?
a. autorelease
b. alloc
c. copy
d. retain
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.
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
Can the iPhone use Bonjour messaging?
a.Yes
b.No
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
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?
@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
Which of the following are valid touch attributes in a UITouch class object?
a. locationInView
b. timestamp
c. phase
d. tapCount
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
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
Before editing the Nibs, one should:
a. Unlock all connections.
b. Lock all connections.
c. Break all connections.
d. None of the above
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
Can you use POSIX sockets on the iPhone?
a.Yes
b.No
Which of the following is true?
a. Every thread has multiple run loops
b. Every application has one and only one run loop
c. Every process has one and only one run loop
d. Every thread has multiple run loops in a single mode
e. Every thread has one and only one run loop