Category Archives: Upwork Mobile Technologies

Upwork Mobile Technologies

iPhone Programming OS 4.0 Test 2016

Published by:

1. The genstrings tool can parse _____.

Answers:

  1. C files with .c filename extension.
  2. Objective-C files with .m filename extension.
  3. Java code files with .java filename extension.
  4. Nib files with any file name extension.

2. Which of the following need to be modified while localizing an application?

Answers:

  1. Nib files (windows, views, menus).
  2. Static text.
  3. Icons and graphics.
  4. Dynamic text generated by your program.

3. Which of the following terms are related to Memory Management in Objective-C?

Answers:

  1. alloc
  2. mutableCopy
  3. delete
  4. release

4. Which of the following properties of the UIImage class are not in use after iOS 4.2?

Answers:

  1. imageOrientation
  2. size
  3. leftCapWidth
  4. topCapHeight

5. What is the return value of SecRandomCopyBytes function of SecRandom class in iPhone OS 4.0 if the function completes successfully?

Answers:

  1. 0
  2. 1
  3. -1
  4. true

6. You want to animate a layer’s opacity to 0 while moving it further away in the layer. Which of the following code snippets will you use?

Answers:

  1. theLayer.opacity=0.0; theLayer.zPosition=0;
  2. theLayer.opacity=0.0; theLayer.zPosition= -100;
  3. theLayer.opacity=0.0; theLayer.zPosition=100;
  4. theLayer.opacity=1.0; theLayer.zPosition=0;

7. What is the value type of UTTypeConformsTo key of uniform type identifier for iPhone OS 4.0?

Answers:

  1. array of dictionaries
  2. array of strings
  3. string
  4. dictionary
  5. integer

8. Which of the following statements is correct regarding functions fopen and open in generic C?

Answers:

  1. fopen returns an error if the file does exist.
  2. fopen does not automatically create the file if it does not exist.
  3. open returns an error if the file does exist.
  4. open returns a file descriptor.

9. Which of the following is the correct syntax for declaring a class in Objective-C?

Answers:

  1. @interface ClassName : ItsSuperclass { instance variable declarations } method declarations @end
  2. @implementation ClassName : ItsSuperclass { instance variable declarations } method declarations @end
  3. @class ClassName : ItsSuperclass { instance variable declarations } method declarations @end
  4. All are correct

10. Which of the following properties of the GKSession class is read-only?

Answers:

  1. available
  2. delegate
  3. displayName
  4. peerID
  5. sessionID

11. Which of the following debugging environments are provided by Xcode to find and squash bugs in your code?

Answers:

  1. Debugging from the text editor
  2. Mini Debugger
  3. Debugger window
  4. GDB debugger console
  5. All of the above

12. When your session becomes active, which of the following iPhone OS 4.0 audio session categories allows other audio to continue playing?

Answers:

  1. AVAudioSessionCategoryAmbient
  2. AVAudioSessionCategorySoloAmbient
  3. AVAudioSessionCategoryPlayback
  4. AVAudioSessionCategoryRecord

13. Which Audio Toolbox framework file defines an interface for reading and writing audio data in files in iPhone OS 4.0?

Answers:

  1. AudioConverter.h
  2. AudioFile.h
  3. AudioFileStream.h
  4. AudioServices.h

14. Which of the following is NOT the default behavior of an audio session in iPhone OS?

Answers:

  1. Playback is disabled and recording is enabled.
  2. When you move the Ring/Silent switch to the “silent” position, your audio is silenced.
  3. When you press the Sleep/Wake button to lock the screen, or when the Auto-Lock period expires, your audio is silenced.
  4. When your audio starts, other audio on the device—such as iPod audio that was already playing—is silenced.

15. Which of the following debugging tasks are provided by Xcode to find and squash bugs in your code?

Answers:

  1. Add and set breakpoints.
  2. View your call stack per thread.
  3. View the value of variables by hovering the mouse pointer over them.
  4. Execute a single line of code.
  5. All of the above

16. Apple’s implementation of HTTP Live Streaming supports DRM (Digital rights management).

Answers:

  1. True
  2. False

17. Which Core Audio Services framework handles positional and low-latency audio services in iPhone OS 4.0?

Answers:

  1. Audio Toolbox
  2. Audio Unit
  3. AV Foundation
  4. Core Audio
  5. OpenAL

18. What are universal binaries in Xcode?

Answers:

  1. These are executable files that can contain code and data for more than one architecture.
  2. These are file references which are generated by the target, such as an application.
  3. These are indexes that contain symbolic information for your project.
  4. These are used to specify build location settings.

19. What is the function of the Code Sense feature in Xcode?

Answers:

  1. Code Sense helps in switching between different circumstances such as development or release.
  2. Code Sense maintains an index that contains important information for your project.
  3. Code Sense creates a cache for the files which are being used frequently.
  4. Code Sense maintains an index of files used in a project.
  5. Code sense is the code completion feature helpful in avoiding typing and syntax errors.

20. Which of the following animation class provides simple interpolation between values for a layer property?

Answers:

  1. CABasicAnimation
  2. CAKeyframeAnimation
  3. CATransition
  4. CAAnimationGroup

21. What will the hitTest: object of the CALayer class return if the point lies outside the receiver’s bounds rectangle?

Answers:

  1. nil
  2. true
  3. false
  4. 0

22. When the genstrings tool discovers a key string used more than once in a single strings file, it:

Answers:

  1. deletes the comments from the individual entries and leaves one comment string without generating a warning.
  2. merges the comments from the individual entries into one comment string and generates a warning.
  3. differentiates the comments from the individual entries into various strings and generates a warning.
  4. None of the above

23. What is the datatype of the clockwise parameter of the CGContextAddArc function of the CGContext class?

Answers:

  1. bool
  2. int
  3. CGFloat
  4. CGContextRef

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

Answers:

  1. C
  2. C++
  3. Objective-C
  4. Objective-C++
  5. Java

25. What is the return value of function CGColorGetAlpha of class CGColor?

Answers:

  1. An alpha intensity value in the range [-1,1]
  2. An alpha intensity value in the range [-0.5,0.5]
  3. An alpha intensity value in the range [0,1]
  4. An alpha intensity value in the range [1,5]

26. How much time in seconds will it take to display an animation if you have 60 images using UIImageView class for the property animationDuration?

Answers:

  1. 1
  2. 2
  3. 10
  4. 15

27. What will the following method call do if the value of the accessed counter is 0?

– (void)discardContentIfPossible

Answers:

  1. It will discard the contents of the object because the counter is 0.
  2. It will not discard the contents of the object because the counter is required to be above 0.
  3. It will not discard the content of the object as a negative counter value is required.
  4. None of the above

28. Consider the following code with 2 alternatives of vector operations for OpenGL ES:

highp float f0, f1;
highp vec4 v0, v1;
Alternative 1: v0 = (v1 * f0) * f1;
Alternative 2: v0 = v1 * (f0 * f1);

Which alternative demonstrates proper use of vector operations?

Answers:

  1. Alternative 1
  2. Alternative 2
  3. Both alternatives demonstrate proper use of vector operations.

29. Which of the following are the Derivative types defined in Objective-C?

Answers:

  1. short
  2. long
  3. long long
  4. int

30. Which of the following properties of the CAKeyframeAnimation class represents an optional array of NSNumber objects that define the duration of each keyframe segment?

Answers:

  1. path
  2. keyTimes
  3. rotationmode
  4. continuityValues

31. Which Core Audio Service framework is used to record, play back, pause, loop, and synchronize audio in iPhone OS 4.0?

Answers:

  1. Audio Queue
  2. Music Sequencing Services
  3. Core Audio Clock
  4. System Sound Services

32. If you want to rotate an object using Core Animation, in radians, in the z axis, which of the following key paths of a layer’s CATransform3D matrix will you use?

Answers:

  1. rotation
  2. rotation.xy
  3. rotation.x
  4. rotation.y
  5. rotation.z

33. What is the default setting to refer to file locations in your Xcode project?

Answers:

  1. Relative to Build Product
  2. Relative to Project
  3. Relative to Enclosing Group
  4. Relative to <source path>
  5. Absolute Path

34. Before editing the Nibs, one should:

Answers:

  1. Unlock all connections.
  2. Lock all connections.
  3. Break all connections.
  4. None of the above

35. What is the default value of the borderColor property of the CALayer class?

Answers:

  1. 0
  2. nil
  3. opaque black
  4. dark black

36. What will be the return value of function ABPersonComparePeopleByName when person1 goes before person2 in class ABPersonComparePeopleByName in iPhone OS 4.0?

Answers:

  1. kCFCompareLessThan
  2. kCFCompareEqualTo
  3. kCFCompareGreaterThan
  4. None of the above

37. What happens if Xcode is not able to find a file or folder at the path defined for it in the project?

Answers:

  1. Xcode skips the file or the folder and continues execution.
  2. Xcode gives an alert with a description of the missing file.
  3. Xcode displays the item in red in the project window.

38. If the code is written using the Core Foundation and Foundation macros, the simplest way to create strings files is:

Answers:

  1. Using an option in the Preferences panel of Interface Builder.
  2. By merging the comments from the individual entries into one comment string.
  3. By unlocking all connections.
  4. By using the genstrings command-line tool.

39. Which of the following copy functions will you use in Objective-C to create an entirely new compound object?

Answers:

  1. Shallow Copy
  2. Deep Copy
  3. Both a and b

40. What is the data type of extendStart parameter of function CGShadingCreateAxial of class CGShading?

Answers:

  1. CGFloat
  2. CGPoint
  3. bool
  4. CGFunctionRef
  5. int

41. What is the datatype of the parameter inValidBitsPerChannel for the function CalculateLPCMFlags in CoreAudioTypes class in iPhone OS 4.0?

Answers:

  1. UInt32
  2. bool
  3. Float32
  4. UInt64

42. What will be the return value of CFHTTPMessageApplyCredentials function of CFHTTPMessage class if the authentication is successful?

Answers:

  1. TRUE
  2. FALSE
  3. nil
  4. 0
  5. 1

43. Which of the following statements regarding Objective-C are correct?

Answers:

  1. In Objective-C, the keyword for NULL is nil.
  2. In Objective-C, #import and #include compiler directives carry out the same operations.
  3. In Objective-C, for the object-oriented constructs (such as method return values), id is the default data type.
  4. The keyword nil has an id with a value of 0.

44. What is the default value of the remoteParticipantVolume property of the class GKVoiceChatService in iPhone OS 4.0?

Answers:

  1. 0.0
  2. 0.5
  3. 1.0
  4. 5.0

45. What is the default value of the fontSize property of the CATextLayer class?

Answers:

  1. 8.0
  2. 12.0
  3. 18.0
  4. 36.0

46. Which part of the HTTP Live Streaming is responsible for taking input streams of media and encoding them digitally?

Answers:

  1. Server component
  2. Distribution component
  3. Client software
  4. None of the above

47. Locking all connections before editing the Nib files can be achieved by using:

Answers:

  1. An option in the Start Menu.
  2. An option in the Preferences panel of Interface Builder.
  3. An option in the Preferences panel of Language Directory.
  4. Any of the above.

48. When you send an object a retain message in Memory Management using Objective-C, what will happen?

Answers:

  1. Its retain count is incremented by 1.
  2. Its retain count is decremented by 1.
  3. Its retain count remains same.
  4. Its retain count is set to 0.

49. When using a Cocoa framework, what will all ControlEvents method of UIControl class return in case it fails to create the object?

Answers:

  1. failure to create
  2. no object to return
  3. status code 420
  4. nil

50. By default, is the search interface visible in the UISearchDisplayController class?

Answers:

  1. Yes
  2. No

51. Which of the following reasons will return a value of NO for the instance method startVideoCapture of class UIImagePickerController?

Answers:

  1. Movie capture is already in progress.
  2. The device does not support movie capture.
  3. The device is out of disk space.
  4. All of the above

52. What will be the value of the clockwise parameter of the CGContextAddArc function of the CGContext class if you want to create a counterclockwise arc?

Answers:

  1. 0
  2. 1
  3. True
  4. False

53. Which of the following types of audio files has NO size restriction?

Answers:

  1. AIFF
  2. WAVE
  3. CAF
  4. All of the above have file size restrictions.

54. Which of the following is NOT a parameter of function SecKeyDecrypt of the class SecCertificate in iPhone OS 4.0?

Answers:

  1. key
  2. padding
  3. cipherText
  4. certificate

55. Which of the following defined types is a dynamic object type in Objective-C?

Answers:

  1. id
  2. Class
  3. SEL
  4. BOOL

56. What is the default value of allowsEditing property of UIImagePickerController class in iPhone OS 4.0?

Answers:

  1. NO
  2. YES
  3. enable
  4. disable

57. Which of the following OpenGL ES objects is a simple 2D graphics image in a specified format?

Answers:

  1. texture
  2. buffer
  3. shaders
  4. renderbuffer
  5. framebuffers

58. Which symbol is used as a syntactic marker for blocks of code in iPhone OS 4.0?

Answers:

  1. ~
  2. $
  3. ^
  4. *

59. Which of the following methods is used for the purpose of creating your view objects in memory management?

Answers:

  1. Initialization methods
  2. loadView
  3. viewDidLoad
  4. dealloc

60. What will happen if an application is running and the user presses the Home button in iPhone OS 4.0 with 3GS?

Answers:

  1. The application will be terminated.
  2. The application will be shifted to background execution context.
  3. The application will continue to run until its execution ends.
  4. The application will be paused.

61. What is the functionality of the beta parameter of function catlas_caxpby in class cblas?

Answers:

  1. Input vector X
  2. Input vector Y
  3. Scaling factor for X
  4. Scaling factor for Y

62. Which of the following are NOT a property of UIImagePickerController class in iPhone OS 4.0?

Answers:

  1. cameraCaptureMode
  2. mediaTypes
  3. startVideoCapture
  4. takePicture
  5. videoQuality

63. While opening Nib files, which of the following should not be ignored?

Answers:

  1. Objects in a Nib file typically have connections between them that should not be broken.
  2. If Objects in a Nib file have broken connections, they should not be restored.
  3. The size of the files.
  4. None of the above

64. Which of the following directives are used to declare and define classes, categories, and protocols?

Answers:

  1. @interface
  2. @implementation
  3. @protocol
  4. @class
  5. @end

65. What will happen if your filename ExampleImage.png is being called as follows:

[UIImage imageNamed:@”ExampleImage.PNG”]

Answers:

  1. The image file will load in the simulator but not in iPhone OS 4.0 because it is case sensitive.
  2. The image file will load in iPhone OS 4.0 but not in the simulator because it is case sensitive.
  3. The file will load in both the simulator and iPhone OS 4.0 because they are both case insensitive.
  4. The file will load neither in the simulator nor in iPhone OS 4.0 because they are both case sensitive.

66. What type of value is assigned to the loc-args child property of alert property in an Apple Push Notification?

Answers:

  1. string
  2. array of strings
  3. number
  4. dictionary

67. What will the following method definition do if the value of the accessed counter is 0?

– (void)discardContentIfPossible

Answers:

  1. It will discard the contents of the object because the counter is 0.
  2. It will not discard the contents of the object because the counter is required to be above 0.
  3. It will not discard the content of the object as a negative counter value is required.
  4. None of the above

68. Which of the following properties of ADBannerView class are read-only?

Answers:

  1. bannerLoaded
  2. currentContentSizeIdentifier
  3. bannerViewActionInProgress
  4. delegate
  5. requiredContentSizeIdentifiers

69. Which of the following are new features to have been introduced in iPhone OS 4.0?

Answers:

  1. Multitasking
  2. Apple Push Notification Service
  3. Local Notification
  4. Gesture Recognizers

2,066 total views, 6 views today

Upwork Mobile Technologies

iOS Programming Test 2016

Published by:

1. Consider the following code:

(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

// Set Background Color/Pattern
self.window.backgroundColor = [UIColor blackColor];
self.tabBarController.tabBar.backgroundColor = [UIColor clearColor];
//self.window.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@”testbg.png”]];

// Set StatusBar Color
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackTranslucent];

// Add the tab bar controller’s current view as a subview of the window
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return YES;
}

How can the error be corrected that gets thrown in the console, “Applications are expected to have a root view controller at the end of application launch”?

Answers:

  1. self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
  2. MenuViewController *menuViewController = [[MenuViewController alloc]init]; self.window.rootViewController = menuViewController;
  3. Both
  4. None of above

2. Which of the following allows it to determine if an application is running on iPhone, or if it’s running on an iPod Touch?

Answers:

  1. NSString *deviceType = [UIDevice currentDevice].model; if([deviceType isEqualToString:@”iPhone”])
  2. NSString *deviceType = [UIDevice currentDevice].Size; if([deviceType isEqualToString:@”iPhone”])
  3. NSString *deviceType = [UIDevice currentDevice].device; if([deviceType isEqualToString:@”Device”])
  4. NSString *deviceType = [UIDevice currentDevice].iPhone; if([deviceType isEqualToString:@”iPhone”])

3. What is true about ARC and manual memory management?

Answers:

  1. Always nil out properties in dealloc under ARC and manual memory management.
  2. Do not have to nil out properties in dealloc under ARC and manual memory management.
  3. nil out properties in dealloc under ARC but not in manual memory management.
  4. nil out properties in dealloc under manual memory management but not in ARC.

4. What does the “strong” property attribute do?

Answers:

  1. It does not extend the lifetime of the object it points to, and automatically becomes nil.
  2. It specifies a reference that does not keep the referenced object alive and is not set to nil.
  3. It makes the object alive, as long as there is a strong pointer to it.
  4. It specifies a reference that does not keep the referenced object alive and is not set to nil.

5. Which of the following is the best practice to find an active internet connection?

Answers:

  1. – (BOOL) connectedToInternet { Reachability *reachability = [Reachability reachabilityForInternetConnection]; NetworkStatus networkStatus = [reachability currentReachabilityStatus]; return !(networkStatus == NotReachable); }
  2. – (BOOL) connectedToInternet { NSString *URLString = [NSString stringWithContentsOfURL:[NSURL URLWithString:@”http://www.google.com”]]; return ( URLString != NULL ) ? YES : NO; }
  3. – (BOOL) connectedToInternet { NSURL *URLString = [NSURL URLWithString:@”http://www.google.com”]; NSData *data = [NSData dataWithContentsOfURL:URLString]; if (data) return YES; else return NO; }
  4. – (BOOL) connectedToInternet { NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL: [NSURL URLWithString:@”http://www.google.com/”]]; [request setHTTPMethod:@”HEAD”]; NSHTTPURLResponse *response; [NSURLConnection sendSynchronousRequest:request returningResponse:&response error: NULL]; return ([response statusCode] == 200) ? YES : NO; }

6. What gets returned if XIB is not properly connected to a parent controller?

Answers:

  1. EXEC_BAD_ACCESS
  2. SIGABRT
  3. SIGKILL
  4. None of these.

7. What is the use of performSelector in iOS?

Answers:

  1. To add a class delegate
  2. To define a class
  3. To call a method of a class
  4. To add a selector method

8. Which of the following is the correct way to get the value of the first object of a NsMutableArray stored in another NsMutableArray?

Answers:

  1. [[myArray objectAtIndex:0] objectAtIndex:0];
  2. [myArray objectAtIndex:0]
  3. [[[myArray objectAtIndex:0] objectAtIndex:0]objectAtIndex:0];
  4. [myArray firstObject]

9. What is the maximum size of an iOS application?

Answers:

  1. 20 MB
  2. 50 MB
  3. 1 GB
  4. 2 GB

10. Which of the following is the correct way to set the font size of UIButton title label?

Answers:

  1. someButton.font = [UIFont systemFontOfSize: 15];
  2. someButton.titleLabel.font = [UIFont systemFontOfSize: 15];
  3. [someButton setFont: [UIFont systemFontOfSize: 15]];
  4. All of the above

11. Which of the following frameworks is needed to apply a border to an object?

Answers:

  1. UIKit
  2. CoreGraphics
  3. QuartzCore
  4. Foundation

12. How can it be detected if the app is running on an iPhone 5?

Answers:

  1. if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone5)
  2. if([[UIScreen mainScreen] bounds].size.height == 568)
  3. if([[UIScreen mainScreen] bounds].size.height == 1136)
  4. if([[UIDevice currentDevice].model isEqualToString:@”iPhone5″])

13. Which of the following is not a valid Touch method with respect to Cocoa Touch programming?

Answers:

  1. – (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
  2. – (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
  3. – (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
  4. None of above

14. Which of the following will return the device’s current location?

Answers:

  1. CLLocationManager locationManager = [[CLLocationManager alloc] init]; [locationManager startUpdatingLocation];
  2. CLLocationManager locationManager = [[CLLocationManager alloc] init]; [locationManager updateLocation];
  3. CLLocationManager locationManager = [[CLLocationManager alloc] init]; [locationManager getLocation];
  4. CLLocationManager locationManager = [[CLLocationManager alloc] init]; [locationManager findLocation];

15. Which of the following is the correct way to print out stack/trace to the console/log in Cocoa application?

Answers:

  1. NSLog(@”%@”,[NSThread callStackSymbols]);
  2. NSLog(@”%@”,[NSThread callStackReturnAddresses ])
  3. NSLog(@”%@”,[NSThread currentThread]);
  4. None of the above.

16. Which of the following is not a valid UIGestureRecognizer?

Answers:

  1. UITapGestureRecognizer
  2. UIZoomGestureRecognizer
  3. UIRotationGestureRecognizer
  4. UIPanGestureRecognizer

17. Which of the following will change the placeholder text color in UITextField?

Answers:

  1. textField.placeHolder.textColor = [UIColor redColor];
  2. textField.placeHolder.textLabel.textColor = [UIColor redColor];
  3. textField.placeHolder.color = [UIColor redColor];
  4. None of the above.

18. Which of the following framework is needed to round corners of UILabel?

Answers:

  1. UIKit
  2. CoreGraphics
  3. QuartzCore
  4. CoreAnimation

19. Which of the following is not a valid icon size for any iOS device (iPhone, iPod, iPad)?

Answers:

  1. 114 x 114
  2. 144 x 144
  3. 72 x 72
  4. 64 x 64

20. Which of the following is not a valid UIGestureRecognizer?

Answers:

  1. UITapGestureRecognizer
  2. UIZoomGestureRecognizer
  3. UIRotationGestureRecognizer
  4. UIPanGestureRecognizer

21. Which of the following will set an image on UIButton?

Answers:

  1. button.image = [UIImage imageNamed:@”btn_img.png”];
  2. button.imageView.image = [UIImage imageNamed:@”btn_img.png”];
  3. [button setImage:[UIImage imageNamed:@”btn_img.png”] forState:UIControlStateNormal];
  4. [button setImageView:[UIImage imageNamed:@”btn_img.png”] forState:UIControlStateNormal];

22. Select all incorrect bundle ID(s):

Answers:

  1. com.company.appName
  2. com.appName
  3. appName
  4. com.company-name.app-name

23. Which of the following will set the font of UISegmentedControl?

Answers:

  1. UIFont *font = [UIFont boldSystemFontOfSize:12.0f]; NSDictionary *attributes = [NSDictionary dictionaryWithObject:font forKey:UITextAttributeFont]; [segmentedControl setTitleTextAttributes:attributes forState:UIControlStateNormal];
  2. [[UISegmentedControl appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@”STHeitiSC-Medium” size:13.0], UITextAttributeFont, nil] forState:UIControlStateNormal];
  3. segmentedControl.transform = CGAffineTransformMakeScale(.6f, .6f);
  4. None of these.

24. Which of the following correctly sets an image on UIButton?

Answers:

  1. button.image = [UIImage imageNamed:@”button_img.png”];
  2. button.imageView.image = [UIImage imageNamed:@”button_img.png”];
  3. [button setImage:[UIImage imageNamed:@”button_img.png”] forState:UIControlStateNormal];
  4. [button setImageView:[UIImage imageNamed:@”button_img.png”] forState:UIControlStateNormal];

25. Which of the following font packages are supported by Cocoa-Touch?

Answers:

  1. .ttf (True Type Font)
  2. .ttc (True Type font Collection)
  3. .otf (Open Type Font)
  4. .dFont (MAC OS X Data Fork Font)

26. Which of the following is not an Open Source Framework/Library?

Answers:

  1. MBProgressHUD
  2. ASIHTTPRequest
  3. RestKit
  4. StoreKit

27. Which of the following is the best way to add a UIToolbar above keyboard?

Answers:

  1. -(void)keyboardWillShow:(NSNotification *)notification { [self.view addSubview:toolbar]; }
  2. -(void)textFieldDidBeginEditing:(UITextField *)textField { [self.view addSubview:toolbar]; }
  3. Always keep UIToolBar visible on screen.
  4. -(void)keyboardWillHide:(NSNotification *)notification { [self.view addSubview:toolbar]; }

28. Select which of the following is not UITableViewCellSelectionStyle values?

Answers:

  1. UITableViewCellSelectionStyleNone
  2. UITableViewCellSelectionStyleBlue
  3. UITableViewCellSelectionStyleLightGray
  4. UITableViewCellSelectionStyletGray

29. What is the correct method to define a delegate object in an ARC Environment?

Answers:

  1. @property (nonatomic, weak) id <MyClassDelegate> delegate;
  2. @property(nonatomic,retain) id <MyClassDelegate> delegate;
  3. @property(nonatomic,weak) <MyClassDelegate> delegate;
  4. @property(nonatomic, weak) NSObject *delegate;

30. Which of the following is the best practice to find active internet connection?

Answers:

  1. – (BOOL) connectedToInternet { Reachability *reachability = [Reachability reachabilityForInternetConnection]; NetworkStatus networkStatus = [reachability currentReachabilityStatus]; return !(networkStatus == NotReachable); }
  2. – (BOOL) connectedToInternet { NSString *URLString = [NSString stringWithContentsOfURL:[NSURL URLWithString:@”http://www.google.com”]]; return ( URLString != NULL ) ? YES : NO; }
  3. – (BOOL) connectedToInternet { NSURL *URLString = [NSURL URLWithString:@”http://www.google.com”]; NSData *data = [NSData dataWithContentsOfURL:URLString]; if (data) return YES; else return NO; }
  4. – (BOOL) connectedToInternet { NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL: [NSURL URLWithString:@”http://www.google.com/”]]; [request setHTTPMethod:@”HEAD”]; NSHTTPURLResponse *response; [NSURLConnection sendSynchronousRequest:request returningResponse:&response error: NULL]; return ([response statusCode] == 200) ? YES : NO; }

31. What will be output of following code?
NSLog(@”%.2f”,[[UIDevice currentDevice].systemVersion floatValue]);

Answers:

  1. 6.1.0
  2. 6.1.2
  3. 6.10
  4. 6.12

32. What is the difference between new and [[alloc]init] in iOS?

Answers:

  1. [[alloc]init] is used to create an object but new is not used to create an object.
  2. Neither [[alloc]init] nor new is used for creating an object.
  3. No difference. Both [[alloc]init] and new are used to create an object.
  4. [[alloc]init] is not used to create object but new is used to an create object.

33. How can the application name of an iOS project be changed?

Answers:

  1. Change Bundle Display Name from info.plist
  2. Rename Project
  3. Change bundle identifier
  4. Create a new project with New name

34. What could be the probable result if selector is unknown or undefined?

Answers:

  1. Causes memory leak
  2. Causes application to terminate with error
  3. Nothing will happen
  4. None of above

35. Is it possible to deploy beta build on any device?

Answers:

  1. Yes beta build can be deployed on any iOS device.
  2. Beta build can be deployed only on devices that are included in Mobile Provision certificate while compiling build.
  3. Beta Build can be deployed only on Simulators.
  4. All of above

36. Which one is true regarding integrating and using custom fonts in an iOS application?

Answers:

  1. Apple rejects the applications that use custom fonts.
  2. Adding fonts to your app plist allows usage directly in the app.
  3. There is no direct way to add fonts; third party APIs are the only way.
  4. You can add fonts, but only if they are provided by Apple.

37. Which of the following is the correct way to set UIButton’s Highlight Tint color programmatically?

Answers:

  1. [button setColor:[UIColor grayColor]];
  2. [button setTintColor:[UIColor grayColor]];
  3. [button setColor:[UIColor grayColor]];
  4. [button TintColor:[UIColor grayColor]];

38. Which of the following properties would be used to draw a shadow under UIView?

Answers:

  1. CGContextRestoreShadowState
  2. CGContextRestoreGState
  3. CGContextSetShadow();
  4. CGContextshadowState

39. Which of the following is the correct way to check whether the view controller view is loaded or visible?

Answers:

  1. if (viewController.isViewLoaded || tabbarController.view.window) { // viewController is visible }
  2. if([[[self tabBarController] selectedViewController] isEqual:self]){ //we’re in the active controller }else{ //we are not }
  3. if (viewController.isLoaded && viewController.view.) { // viewController is visible }
  4. if (viewController.isViewLoaded && viewController.view.window) { // viewController is visible }

40. Which of the following is the correct way to transfer data from one view controller to another?

Answers:

  1. EditingViewController *controller = [[EditingViewController alloc] initWithNibName:@”EditingView” bundle:nil]; controller.editedObject = book; … [self.navigationController pushViewController:controller animated:YES]; [controller release]; In the Editing View (EditingViewController): – (IBAction)save { … [editedObject setValue:datePicker.date forKey:editedFieldKey]; [editedObject setValue:textField.text forKey:editedFieldKey]; } [self.navigationController popViewControllerAnimated:YES]; }
  2. NSString *commString; in appDelegate. And then when you submit the uitextfield value just assign that text field value to the appDelegate.commString use this in the next view. ProjectNameAppDelegate *appDelegate = [[UIApplication sharedApplicatoin] delegate]; appDelegate.commString = textField.text;
  3. Both 1 and 2 methods are correct.
  4. None of above are correct.

41. Which of the following UILabel properties help adjust text within a UILabel?

Answers:

  1. lineBreakMode
  2. adjustsFontSizeToFitWidth
  3. numberOfLines
  4. drawTextInRect:

42. Which of the following is the correct way to set the Navigation Bar Color of the Tab Bar Configure Menu?

Answers:

  1. “UINavigationController *navigationController; … navigationController.navigationBar.tintColor = [UIColor blackColor];”
  2. “UINavigationController *navigationController; … navigationController.tintColor = [UIColor blackColor];”
  3. “UINavigationController *navigationController; … navigationController.color = [UIColor blackColor];”
  4. “UINavigationController *navigationController; … navigationController.navigationBar.Color = [UIColor blackColor];”

43. What does EXC_BAD_ACCESS signal received mean in Xcode?

Answers:

  1. Due to warning in code
  2. “Owning” the memory but forgetting to release
  3. Testing on a device without registering UDID
  4. Using incorrect delegate methods

44. Which of the following is best JSON library to be used in iOS applications?

Answers:

  1. SBJSON
  2. JSON kit
  3. Touch JSON
  4. None of these

45. How can an SMS be sent programmatically from the iPhone (iOS 4.0 or later)?

Answers:

  1. Using MFMessageComposeViewController
  2. [[UIApplication sharedApplication] openURL: @”sms:PHONE-NUMBER”];
  3. Both A &B are correct answers
  4. The official SDK/Cocoa Touch doesn’t allow sending SMSs programmatically

46. What is the difference between assign and retain in Objective-C?

Answers:

  1. assign – Specifies that a copy of the object should be used for assignment. The previous value is sent a release message. retain – Specifies that the setter uses simple assignment. The previous value is sent a release message.
  2. assign – Specifies that the setter uses simple assignment. This is the default. retain – Specifies that retain should be invoked on the object upon assignment. The previous value is sent a release message.
  3. assign – Increases the count of an object by 1. Takes ownership of an object. retain – Decreases the retain count of an object by 1. Relinquishes ownership of an object.
  4. assign – Makes a assign of an object, and returns it with retain count of 1. If you copy an object, you own the copy. retain – Specifies that a retain of the object should be used for assignment. The previous value is sent a release message.

47. Which property would be used to get the UDID of UIDevice on iOS?

Answers:

  1. [UIDevice UDIDString]
  2. [UIDevice uniqueIdentifier]
  3. -[UIDevice identifierForVendor]
  4. None of these

48. When does this behavior usually happen?
“Xcode Message: finished running <my app>” on targeted device shows, but nothing happens

Answers:

  1. If the app was ran on earlier devices (3G or 3GS) and arm6 was not added in Require Device Capabilities.
  2. If app was built and ran on version 3.2 or earlier of Xcode and arm7 was not added in Require Device Capabilities.
  3. If Bundle Identifier used in the project is being used by another project
  4. When some another application is already running on device
  5. When the device is locked with a passcode

49. Is it possible to set multiple architecture from Build Settings tab in Xcode for a project?

Answers:

  1. Yes
  2. No
  3. only in Xcode 4.5 or later
  4. only in Xcode 4.5 or previous

50. Which framework can be used to call SOAP web services in iOS applications?

Answers:

  1. gSOAP
  2. ASIHTTP framework
  3. wsdl2objc framework
  4. None of these

51. What property in info.plist handles the association of file types in an iPhone application?

Answers:

  1. LSItemContentTypes
  2. LSHandlerRank
  3. CFBundleTypeName
  4. CFBundleTypeRole

52. Which method of Objective-C handles detecting the shake gesture on an iOS device?

Answers:

  1. + (UIAccelerometer *)sharedAccelerometer
  2. – (void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
  3. – (void) accelerometer:(UIAccelerometer *)accelerometer willAccelerate:(UIAcceleration *)acceleration
  4. – (void) accelerometer:(UIAccelerometer *)accelerometer beginAccelerate:(UIAcceleration *)acceleration

53. Which one is the best resolution for the following error?
“A valid signing identity matching this profile could not be found in your keychain”

Answers:

  1. Installing the certificate file in your keychain
  2. Renewing your provisioning profile
  3. Installing the private key in your keychain
  4. Renewing your Apple developer account.

54. What is the best way to show multiple lines text in the UILabel?

Answers:

  1. CGRect currentFrame = myLabel.frame; CGSize max = CGSizeMake(myLabel.frame.size.width, 500); label.font = [UIFont systemFontOfSize:13.0]; CGSize expected = [myString sizeWithFont:myLabel.font]; myLabel.numberOfLines = 0;
  2. CGRect currentFrame = myLabel.frame; CGSize max = CGSizeMake(myLabel.frame.size.width, -1); CGSize expected = [myString sizeWithFont:myLabel.font]; myLabel.numberOfLines = -1;
  3. myLabel.numberOfLines = 0; CGRect currentFrame = myLabel.frame; CGSize max = CGSizeMake(myLabel.frame.size.width, 500); CGSize expected = [myString sizeWithFont:myLabel.font constrainedToSize:max lineBreakMode:myLabel.lineBreakMode]; currentFrame.size.height = expected.height; myLabel.frame = currentFrame;
  4. You have to use UITextView for this purpose, otherwise Apple will rejects your app submission

55. Which of the following correctly describes when the – (void)viewDidUnload method is called?

Answers:

  1. When the application launches.
  2. When any view appears.
  3. When a view is released.
  4. During low memory conditions when the view controller needs to release its view.

56. Which of the following is not a valid MKAnnotationView property?

Answers:

  1. canShowCallout
  2. draggable
  3. dragState
  4. None of these.

57. What does a “__block” type specifier mean?

Answers:

  1. Modifications made with the variable marked with __block inside the block are not visible outside of it.
  2. Modifications done with the variable marked with __block inside the block are also visible outside of it.
  3. It makes the variable non-mutable within the block.
  4. None of the above

58. Which of the following is not a valid MPVolumeView method?

Answers:

  1. – (CGRect)volumeThumbRectForBounds:(CGRect)bounds volumeSliderRect:(CGRect)rect value:(float)value
  2. – (UIImage *)maximumVolumeSliderImageForState:(UIControlState)state
  3. – (CGRect)routeButtonRectForBounds:(CGRect)bounds
  4. – (void)setVolumeThumbImage:(UIImage *)image

59. Which of the following code samples will declare a variable inside a block in Objective-C?

Answers:

  1. Person *aPerson = nil; [participants enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { Person *participant = (Person*)obj; if ([participant.gender isEqualToString:@”M”]) { aPerson = participant; *stop = YES; } }]; return aPerson;
  2. __block Person *aPerson = nil; [participants enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { Person *participant = (Person*)obj; if ([participant.gender isEqualToString:@”M”]) { aPerson = participant; *stop = YES; } }]; return aPerson;
  3. [participants enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { Person *participant = (Person*)obj; Person *aPerson = nil; if ([participant.gender isEqualToString:@”M”]) { aPerson = participant; *stop = YES; } }]; return aPerson;
  4. All of the above.

4,436 total views, 18 views today