Controller View Getting wrong position - objective-c

I have application with Objective C which is developed for ios9 devices, when am trying to run the same code in xcode 8 am getting wrong position of my navigation bar,
Am using viewcontroller as a XIB and am converting into navigation controller in appdelegate class. is any one met this issue

You can try following solution:
Select your Xib file of viewController.
On the right side, navigate to the File Inspector tab.
Change the value for "Build for" to "iOS 7.0 and Later" or any other iOS version and later.
Clean, Rebuild and Run project.

Related

Navigated my obj C code from Xcode 6.4 to Xcode 7(stable version) and app hangs when I try to push a view controller

Navigated my code from Xcode 6.4 to Xcode 7(stable version) and app hangs when I try to push a particular view controller. The code works perfectly fine in Xcode 6.5 iOS 9 but hangs in Xcode 7 iOS 9. The CPU usage reaches up to 90% and the app just freezes, nothing happens.
The controller being pushed has a UITableViewController with each cell having a UITextView and a UILabel. All other controllers work fine. I am using storyboard in my app.
The UITextView in the cells had a non-empty text attribute set in the Xib. Removing that text value worked for me.
To make it work with the text value, I had to select 'English' under 'Localization' in File Inspector. By default, only 'Base' was selected.

Missing proxy for identifier UIStoryboardPlaceholder [duplicate]

This question already has answers here:
Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?
(79 answers)
Closed 7 years ago.
Hi I seem to have stumbled upon weird thing while developing a storyboard app.
My app is halted right after splash screen and in console I get error message:
Missing proxy for identifier UIStoryboardPlaceholder
Now, if I try to let the app continue running, I get new messages into console, which I believe are related to the fact, that there is something wrong with the first error message
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason:
'[<IntroViewController 0x6e35f40> setValue:forUndefinedKey:]:
this class is not key value coding-compliant for the key sceneViewController.
What is strange I get this error only when working with iOs 5.1 Simulator. It works fine on iOs 6 simulator and also on devices with both iOs 6 and iOs 5.1
I tried to find answer, but google says it could not find any results for the word UIStoryboardPlaceholder, let alone the whole error message. I made sure, I don't have the word 'UIStoryboardPlaceholder' anywhere within my xcode project(not even inside nib files) and also there's nowhere mentioned 'sceneViewController'. Any idea what might be wrong?
EDIT: I tried to reset simulator and cleaning project, but to no avail
We had the same problem: a view controller in a storyboard file with its interface defined in a separate XIB file. (Using Xcode 6.3.1, iOS 8.3 and Swift 1.2.)
We are using Swift so we had added the #objc() declaration to the class declaration:
#objc(TestViewController) class TestViewController: UIViewController
We could instantiate the view controller just fine from another view controller using self.storyboard?.instantiateViewControllerWithIdentifier( "TestViewController" ) but when presenting the view controller (using self.presentViewController( viewController, animated: true, completion: nil )) the app crashed with the same "missing proxy" and "not key value coding-compliant for the key sceneViewController" error.
Our solution which we found after much frustrated trial-and-error-like debugging was simply make sure the view controller's Storyboard ID in the storyboard file is not the same as the class name.
When we renamed the Storyboard ID from "TestViewController" to "testViewController" (only difference being the lower-case first letter), everything worked…
Strange? You betcha, but everything seems to be working now.
I had the same problem. Try cleaning the project and restoring the simulator.
I was getting the same error with an app that I was converting from .xib files to storyboards. My app contained a UITabBarController, and tapping on certain tabs would trigger the error.
In my case, the problem was that I had copied view controllers into the storyboard that used the "NIB name" property to load the view controller's view from an external .xib file. Storyboard view controllers do not support loading views from .xib files, so my storyboard contained a view controller that had no view.
I opened the external .xib file, copied the view, pasted it into the corresponding view controller in my storyboard, and made sure that the pasted view was subordinate (indented under) the view controller in the storyboard scene. Then I re-connected the view to the outlets in the view controller.
When I re-ran the application, the error was gone.
Add me to the list. I get this error after "refactoring - rename" on a class. The class I am renaming is a custom ViewController with its own .xib. I use Storyboard which launches a viewController containing a "Container View", which has my custom ViewController embedded in it upon launch.
The only way out of this so far is to NOT use my refactored .xib (disconnect it from the container view).
My semi-solution:
I have restored my app from a prior working snapshot and created a new custom ViewController and .xib from scratch instead of refactoring. Connected it to Storyboard and I got the error message again. Cleaned the build and deleted the app from the simulator and re-ran, and then it magically ran without error. For this reason I believe there is a bug in Xcode with Refactor-Rename, which corrupts some storyboard file behind-the-scenes. Once I confirmed that the new .xib was attaching to storyboard without error, I copied/pasted the class code into the new custom viewController class, and went through the process of reconnecting the class objects to the .xib, as you'd expect. Ran it and everything still worked.
FYI - here are some of the FAILED steps I took in my attempt to recover from the error (before giving up and restoring snapshot).
1. Cleaning Build.
2. Deleting App in iOS simulator.
3. Deleting all views in the custom ViewController .xib.
4. Naming the custom ViewController something else.
5. In Storyboard, adding a blank view to the ViewController representing my custom Viewcontroller class. This worked and allowed my app to run, however my custom class was neither able to load its own views in place of this default blank view, nor were it's own views visible upon making the default blank view transparent. Debugging showed my custom class .xib views being nil when assigned to self.view.
I am presently avoiding Xcode's Refactor-Rename for files having a .xib.
I had the same errors, finally solved it.
My problem was that I had :
[[storyboard instantiateViewControllerWithIdentifier:#"TripDetail"] methodThatDoesNotExist:#"param"]

using a storyboard from another project

I am working on an Iphone Application, and I want to get a storyboard from another project.
I added the storyboard and all the viewcontrollers and images to my project (I copy Paste them from the other project)
Then I set it as the main storyboard in the info,plist file.
I get no compile errors or warnings however if I try to run the project I get a signal SIGABRT error.
(If i return to my original storyboard the app runs normally)
Any idea what might be causing the problem?
Thanks a lot for any help
Have you wired all storyboard object to proper ViewController ?
I often forget wiring delegate =)
In the summary tab make sure that the main storyboard is selected under "project name"/summery/ iPhone/iPod deployment info

How to replace the FirstViewController in a TabBar app with another view controller (Kal)?

I created an empty iPad TabBar application using XCode 4, without storyboards. I placed that app in a workspace. I then added the Kal source (obtained from the iPad Juice build) to the workspace as a separate project. The initial build was clean.
I then went to the Kal example (NativeKal) and added EventKitDataSource.h and .m, and NativeCalAppDelegate.h and .m. (The image below shows what files are in the example project)
This is the code from the NativeCalAppDelegate.h file:
I tried setting the first TabBar UIView controller to "KalViewController" as I would normally do when using Storyboards, but it isn't listed in the drop down list of classes.
The question is: how do I get the NativeCal example view controller to replace FirstViewController in the in my TabBar application?
Comments added as Answer.
My recommendation is to switch to storyboards it is a lot easier to do UITabBarControllers in them. You can do this by just creating a new storyboard and copy and paste everything into it and then control drag from the UITabBarController to the UIViewControllers that you want to be linked to the tab bar controller and it does the rest for you, everything else is the same after that. In storyboards you can set the first view controller to be loaded so if you need it to be KalController then you can set it when you set up the UITabBarController. You can also set this in the code. I found that storyboards were a great new feature to xcode, UITabBarCotrollers are a lot easier to do in them then in .nib files I could never get them to work.
Hope this has helped.

IKImageView Causes App to Crash

I am new to ObjC. Thanks in advance for your help and patience!
I'm trying to add an image to a window in my app (This is OSX, not iOS). I added an Image View (IKImageView) via interface builder to the window. I then added my image to the XCode Project and assigned it to the view.
When I try to compile the app it crashes with the error: "cannot decode object of class (IKImageView)".
The moment I delete the IKImageView it compiles just fine.
My initial thought was that I wasn't importing the required file, but this appears to be a subclass of NSView, so that shouldn't be the problem.
Any thoughts as to what I'm doing wrong?
Select the project on the left side of Xcode.
You will see the "summary" tab on the right side. Select it.
Add Quartz.framework into "Linked Frameworks and Libraries".