[window addSubview:[someController view]];
to
[self.window setRootViewController:XViewController];
Top 5 Frequently Asked iOS Interview Questions And Answers.
Most Important iPhone interview Questions and Answers
Note:
If You are using simply UINavigationController then replace
with the following line .
[[UINavigationController] initWithRootViewController:XViewController];
and then use the code below.
[self.window setRootViewController:self.navigationController] ;
In order to set the window's root view controller .
Read:-
Best Tutorials- Properties in objective C
Top 5 Simple iOS Interview Questions And Answers
2.Xcode 'CodeSign error: code signing is required'
Answer:-
Xcode gives error when it doesn't match or recognize your certificate.
There are lot of possible ways to solve this issue.It's sometimes difficult to resolve.First of all follow the the below procedure.
Step1 .
Go to "Window" tab->Organiser->ViewDetails.
Step 2:-
Try to remove the provisioning that are in your device. Then re-add them (download them again on the apple website). And try to compile again.It should work successfully.
Note:-
1) Make sure "Code Signing Identity" is NOT "Don't Code Sign". Pick a profile to sign with a valid provisional certificate or team provisional certificate both in "Project" and "Target".It should compile without any issue.
What is the difference between IBOutlet and IBAction in iOS ?
Top iOS interview Questions And Answers Collection
3.SpringBoard failed to launch application with error
Answer:-
Springboard (also known as Home Screen) is the standard application that manages the iOS home screen
step1: Goto Simulator -> Click Reset and Content and settings.
b) Now clean, build and run your application. Hope it will work.
Read:
What are the differences between Cocoa and Cocoa Touch?
Top 5 Basic iOS Questions Asked in interviews
4.Getting black screen after launching iOS simulator from Xcode
Answer:-
After clicking "Run" in Xcode, It compiles and builds successfully, launches iOS simulator but it never gets to loading the app. Only the status bar at the top. It displays a black screen.
Step: Go to iOS Simulator menu-> "Reset Content and Settings".
It should work.
Top iOS Interview Questions And Answers for Beginners
iOS Interview Questions with Answers part 4
5.Unrecognized selector sent to instance error
Answer:-
The unrecognized selector error means that somewhere in your project, a method was called on an object and there is no such methods on that object .
so it crashes. “Selector” is another term for a method.
So now you can go back to your code and see where you’re calling the method and why the object doesn’t have that method.
Check if that method exists in the header (.h) file of the class and pay attention to the parameters and letter casing to make sure it matches.
If you’re calling a method on a IBOutlet property that is referring to an element in your storyboard, then make sure that the UIElement has it’s custom class set to the class that has the actual method.
Read:
some key concepts for an iPhone developer to learn as a fresher
What are best practices that you use when developing projects in Objective-C ?
6.This class is not key value coding-compliant for the key
answer:-
*** Terminating app due to uncaught exception ‘NSUnknownKeyException’, reason: ‘[setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key handleButtonClick.
This error may indicate that there’s a IBoutlet in your Storyboard that’s connected to a property which doesn’t exist anymore.
This can occur if you connected the UIElement to a property and then removed the property from the .h file.
In order to fix it, go into your storyboard and right click each element to check the connections to the properties and “break” any connections to properties that don’t exist in your .h file anymore by clicking the little “x” beside each bad connection
Read:
Application's Background Transition Cycle in iOS
How to start a long-running task when your app goes to the background in iOS ?