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:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
NSLog(@”%.2f”,[[UIDevice currentDevice].systemVersion floatValue]);
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
“Xcode Message: finished running <my app>” on targeted device shows, but nothing happens
Answers:
Answers:
Answers:
Answers:
Answers:
“A valid signing identity matching this profile could not be found in your keychain”
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
Answers:
(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:
- self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
- MenuViewController *menuViewController = [[MenuViewController alloc]init]; self.window.rootViewController = menuViewController;
- Both
- None of above
Answers:
- NSString *deviceType = [UIDevice currentDevice].model; if([deviceType isEqualToString:@”iPhone”])
- NSString *deviceType = [UIDevice currentDevice].Size; if([deviceType isEqualToString:@”iPhone”])
- NSString *deviceType = [UIDevice currentDevice].device; if([deviceType isEqualToString:@”Device”])
- NSString *deviceType = [UIDevice currentDevice].iPhone; if([deviceType isEqualToString:@”iPhone”])
Answers:
- Always nil out properties in dealloc under ARC and manual memory management.
- Do not have to nil out properties in dealloc under ARC and manual memory management.
- nil out properties in dealloc under ARC but not in manual memory management.
- nil out properties in dealloc under manual memory management but not in ARC.
Answers:
- It does not extend the lifetime of the object it points to, and automatically becomes nil.
- It specifies a reference that does not keep the referenced object alive and is not set to nil.
- It makes the object alive, as long as there is a strong pointer to it.
- It specifies a reference that does not keep the referenced object alive and is not set to nil.
Answers:
- – (BOOL) connectedToInternet { Reachability *reachability = [Reachability reachabilityForInternetConnection]; NetworkStatus networkStatus = [reachability currentReachabilityStatus]; return !(networkStatus == NotReachable); }
- – (BOOL) connectedToInternet { NSString *URLString = [NSString stringWithContentsOfURL:[NSURL URLWithString:@”http://www.google.com”]]; return ( URLString != NULL ) ? YES : NO; }
- – (BOOL) connectedToInternet { NSURL *URLString = [NSURL URLWithString:@”http://www.google.com”]; NSData *data = [NSData dataWithContentsOfURL:URLString]; if (data) return YES; else return NO; }
- – (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; }
Answers:
- EXEC_BAD_ACCESS
- SIGABRT
- SIGKILL
- None of these.
Answers:
- To add a class delegate
- To define a class
- To call a method of a class
- To add a selector method
Answers:
- [[myArray objectAtIndex:0] objectAtIndex:0];
- [myArray objectAtIndex:0]
- [[[myArray objectAtIndex:0] objectAtIndex:0]objectAtIndex:0];
- [myArray firstObject]
Answers:
- 20 MB
- 50 MB
- 1 GB
- 2 GB
Answers:
- someButton.font = [UIFont systemFontOfSize: 15];
- someButton.titleLabel.font = [UIFont systemFontOfSize: 15];
- [someButton setFont: [UIFont systemFontOfSize: 15]];
- All of the above
Answers:
- UIKit
- CoreGraphics
- QuartzCore
- Foundation
Answers:
- if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone5)
- if([[UIScreen mainScreen] bounds].size.height == 568)
- if([[UIScreen mainScreen] bounds].size.height == 1136)
- if([[UIDevice currentDevice].model isEqualToString:@”iPhone5″])
Answers:
- – (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
- – (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
- – (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
- None of above
Answers:
- CLLocationManager locationManager = [[CLLocationManager alloc] init]; [locationManager startUpdatingLocation];
- CLLocationManager locationManager = [[CLLocationManager alloc] init]; [locationManager updateLocation];
- CLLocationManager locationManager = [[CLLocationManager alloc] init]; [locationManager getLocation];
- CLLocationManager locationManager = [[CLLocationManager alloc] init]; [locationManager findLocation];
Answers:
- NSLog(@”%@”,[NSThread callStackSymbols]);
- NSLog(@”%@”,[NSThread callStackReturnAddresses ])
- NSLog(@”%@”,[NSThread currentThread]);
- None of the above.
Answers:
- UITapGestureRecognizer
- UIZoomGestureRecognizer
- UIRotationGestureRecognizer
- UIPanGestureRecognizer
Answers:
- textField.placeHolder.textColor = [UIColor redColor];
- textField.placeHolder.textLabel.textColor = [UIColor redColor];
- textField.placeHolder.color = [UIColor redColor];
- None of the above.
Answers:
- UIKit
- CoreGraphics
- QuartzCore
- CoreAnimation
Answers:
- 114 x 114
- 144 x 144
- 72 x 72
- 64 x 64
Answers:
- UITapGestureRecognizer
- UIZoomGestureRecognizer
- UIRotationGestureRecognizer
- UIPanGestureRecognizer
Answers:
- button.image = [UIImage imageNamed:@”btn_img.png”];
- button.imageView.image = [UIImage imageNamed:@”btn_img.png”];
- [button setImage:[UIImage imageNamed:@”btn_img.png”] forState:UIControlStateNormal];
- [button setImageView:[UIImage imageNamed:@”btn_img.png”] forState:UIControlStateNormal];
Answers:
- com.company.appName
- com.appName
- appName
- com.company-name.app-name
Answers:
- UIFont *font = [UIFont boldSystemFontOfSize:12.0f]; NSDictionary *attributes = [NSDictionary dictionaryWithObject:font forKey:UITextAttributeFont]; [segmentedControl setTitleTextAttributes:attributes forState:UIControlStateNormal];
- [[UISegmentedControl appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIFont fontWithName:@”STHeitiSC-Medium” size:13.0], UITextAttributeFont, nil] forState:UIControlStateNormal];
- segmentedControl.transform = CGAffineTransformMakeScale(.6f, .6f);
- None of these.
Answers:
- button.image = [UIImage imageNamed:@”button_img.png”];
- button.imageView.image = [UIImage imageNamed:@”button_img.png”];
- [button setImage:[UIImage imageNamed:@”button_img.png”] forState:UIControlStateNormal];
- [button setImageView:[UIImage imageNamed:@”button_img.png”] forState:UIControlStateNormal];
Answers:
- .ttf (True Type Font)
- .ttc (True Type font Collection)
- .otf (Open Type Font)
- .dFont (MAC OS X Data Fork Font)
Answers:
- MBProgressHUD
- ASIHTTPRequest
- RestKit
- StoreKit
Answers:
- -(void)keyboardWillShow:(NSNotification *)notification { [self.view addSubview:toolbar]; }
- -(void)textFieldDidBeginEditing:(UITextField *)textField { [self.view addSubview:toolbar]; }
- Always keep UIToolBar visible on screen.
- -(void)keyboardWillHide:(NSNotification *)notification { [self.view addSubview:toolbar]; }
Answers:
- UITableViewCellSelectionStyleNone
- UITableViewCellSelectionStyleBlue
- UITableViewCellSelectionStyleLightGray
- UITableViewCellSelectionStyletGray
Answers:
- @property (nonatomic, weak) id <MyClassDelegate> delegate;
- @property(nonatomic,retain) id <MyClassDelegate> delegate;
- @property(nonatomic,weak) <MyClassDelegate> delegate;
- @property(nonatomic, weak) NSObject *delegate;
Answers:
- – (BOOL) connectedToInternet { Reachability *reachability = [Reachability reachabilityForInternetConnection]; NetworkStatus networkStatus = [reachability currentReachabilityStatus]; return !(networkStatus == NotReachable); }
- – (BOOL) connectedToInternet { NSString *URLString = [NSString stringWithContentsOfURL:[NSURL URLWithString:@”http://www.google.com”]]; return ( URLString != NULL ) ? YES : NO; }
- – (BOOL) connectedToInternet { NSURL *URLString = [NSURL URLWithString:@”http://www.google.com”]; NSData *data = [NSData dataWithContentsOfURL:URLString]; if (data) return YES; else return NO; }
- – (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; }
NSLog(@”%.2f”,[[UIDevice currentDevice].systemVersion floatValue]);
Answers:
- 6.1.0
- 6.1.2
- 6.10
- 6.12
Answers:
- [[alloc]init] is used to create an object but new is not used to create an object.
- Neither [[alloc]init] nor new is used for creating an object.
- No difference. Both [[alloc]init] and new are used to create an object.
- [[alloc]init] is not used to create object but new is used to an create object.
Answers:
- Change Bundle Display Name from info.plist
- Rename Project
- Change bundle identifier
- Create a new project with New name
Answers:
- Causes memory leak
- Causes application to terminate with error
- Nothing will happen
- None of above
Answers:
- Yes beta build can be deployed on any iOS device.
- Beta build can be deployed only on devices that are included in Mobile Provision certificate while compiling build.
- Beta Build can be deployed only on Simulators.
- All of above
Answers:
- Apple rejects the applications that use custom fonts.
- Adding fonts to your app plist allows usage directly in the app.
- There is no direct way to add fonts; third party APIs are the only way.
- You can add fonts, but only if they are provided by Apple.
Answers:
- [button setColor:[UIColor grayColor]];
- [button setTintColor:[UIColor grayColor]];
- [button setColor:[UIColor grayColor]];
- [button TintColor:[UIColor grayColor]];
Answers:
- CGContextRestoreShadowState
- CGContextRestoreGState
- CGContextSetShadow();
- CGContextshadowState
Answers:
- if (viewController.isViewLoaded || tabbarController.view.window) { // viewController is visible }
- if([[[self tabBarController] selectedViewController] isEqual:self]){ //we’re in the active controller }else{ //we are not }
- if (viewController.isLoaded && viewController.view.) { // viewController is visible }
- if (viewController.isViewLoaded && viewController.view.window) { // viewController is visible }
Answers:
- 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]; }
- 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;
- Both 1 and 2 methods are correct.
- None of above are correct.
Answers:
- lineBreakMode
- adjustsFontSizeToFitWidth
- numberOfLines
- drawTextInRect:
Answers:
- “UINavigationController *navigationController; … navigationController.navigationBar.tintColor = [UIColor blackColor];”
- “UINavigationController *navigationController; … navigationController.tintColor = [UIColor blackColor];”
- “UINavigationController *navigationController; … navigationController.color = [UIColor blackColor];”
- “UINavigationController *navigationController; … navigationController.navigationBar.Color = [UIColor blackColor];”
Answers:
- Due to warning in code
- “Owning” the memory but forgetting to release
- Testing on a device without registering UDID
- Using incorrect delegate methods
Answers:
- SBJSON
- JSON kit
- Touch JSON
- None of these
Answers:
- Using MFMessageComposeViewController
- [[UIApplication sharedApplication] openURL: @”sms:PHONE-NUMBER”];
- Both A &B are correct answers
- The official SDK/Cocoa Touch doesn’t allow sending SMSs programmatically
Answers:
- 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.
- 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.
- 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.
- 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.
Answers:
- [UIDevice UDIDString]
- [UIDevice uniqueIdentifier]
- -[UIDevice identifierForVendor]
- None of these
“Xcode Message: finished running <my app>” on targeted device shows, but nothing happens
Answers:
- If the app was ran on earlier devices (3G or 3GS) and arm6 was not added in Require Device Capabilities.
- If app was built and ran on version 3.2 or earlier of Xcode and arm7 was not added in Require Device Capabilities.
- If Bundle Identifier used in the project is being used by another project
- When some another application is already running on device
- When the device is locked with a passcode
Answers:
- Yes
- No
- only in Xcode 4.5 or later
- only in Xcode 4.5 or previous
Answers:
- gSOAP
- ASIHTTP framework
- wsdl2objc framework
- None of these
Answers:
- LSItemContentTypes
- LSHandlerRank
- CFBundleTypeName
- CFBundleTypeRole
Answers:
- + (UIAccelerometer *)sharedAccelerometer
- – (void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
- – (void) accelerometer:(UIAccelerometer *)accelerometer willAccelerate:(UIAcceleration *)acceleration
- – (void) accelerometer:(UIAccelerometer *)accelerometer beginAccelerate:(UIAcceleration *)acceleration
“A valid signing identity matching this profile could not be found in your keychain”
Answers:
- Installing the certificate file in your keychain
- Renewing your provisioning profile
- Installing the private key in your keychain
- Renewing your Apple developer account.
Answers:
- 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;
- CGRect currentFrame = myLabel.frame; CGSize max = CGSizeMake(myLabel.frame.size.width, -1); CGSize expected = [myString sizeWithFont:myLabel.font]; myLabel.numberOfLines = -1;
- 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;
- You have to use UITextView for this purpose, otherwise Apple will rejects your app submission
Answers:
- When the application launches.
- When any view appears.
- When a view is released.
- During low memory conditions when the view controller needs to release its view.
Answers:
- canShowCallout
- draggable
- dragState
- None of these.
Answers:
- Modifications made with the variable marked with __block inside the block are not visible outside of it.
- Modifications done with the variable marked with __block inside the block are also visible outside of it.
- It makes the variable non-mutable within the block.
- None of the above
Answers:
- – (CGRect)volumeThumbRectForBounds:(CGRect)bounds volumeSliderRect:(CGRect)rect value:(float)value
- – (UIImage *)maximumVolumeSliderImageForState:(UIControlState)state
- – (CGRect)routeButtonRectForBounds:(CGRect)bounds
- – (void)setVolumeThumbImage:(UIImage *)image
Answers:
- 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;
- __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;
- [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;
- All of the above.
No comments:
Post a Comment