StoryBoard issue in Xcode 6.1 - ios

I am having the project which is successfully done the project in Xcode 5.1 using story board, I am running the project in Xcode 6.1 now its showing the error in Xcode 6.1. I am getting the error as
Main_iPhone.storyboard: error: Illegal Configuration: Static table views are only valid when embedded in UITableViewController instances
How to resolve this error and make the project run in 64 bit and support to iOS8
Hoping for the right answers.

Xcode 6 supports static tableviews only inside a UITableViewController, general purpose UIViewController with static UITableView inside are not allowed anymore.
To resolve you can follow 2 ways:
- put all the static content inside arrays, declare a table delegate and load all the content runtime. (Best solution)
- Put your static content inside a UITableViewController and embed it with a Container View inside your UIViewController (this will be more tricky if you have to intercept events of static table)

Related

IB Designables: Failed to render and update auto layout status - The agent crashed

I am working on an existing iOS Project in Xcode 10.2.1 on macOS 10.14.4. The uses mainly Objectiv-C but also some Swift Pods (v. 1.5.2). Recently I have also added the first Swift based ViewController using Swift 5.
The Problem:
When working on the XIB file of this Swift bases ViewController after a short time the following error message is shown in the Xcode sidebar:
IB Designables: Failed to render and update auto layout status for
ViewXYZ (abc-de-123): The agent crashed
As soon as there error occur no changes in the Interface Builder (added view, changed colors, text, etc.) are shown anymore. When I re-open the XIB file it only show grey view placeholders instead of the real content.
The problem can only be solved by re-starting Xcode but when working on the XIB again it shows up after again after just a few moment.
Things that did NOT work
Since the problem is realted to IB Designabales I checked these first. Within the ViewController I am using two different custom views which are implemented in Objective-C and marked as IB_DESIGNABLE.
These views have not been changed recently and it was never a problem to use them before. Removing all custom code from these views did not change the problem. Thus there seems to be nothing wrong with the implementation.
I found other topics dealing with similar issues, but none of the different solutions worked for me:
Re-starting the Mac, re-starting Xcode, cleaning the build folder or deleting ~/Library/Developer/Xcode/DerivedData does NOT solve the problem
Adding this code to the pod file does NOT solve the problem
Adding all UIView constructors to the views as proposed here does NOT solve the problem.
Xcode shows that the designables are up to date and does NOT offer a debug button (as shown here)
The views do not have orphant outlets
Re-creating the XIB from scratch let to the same issue
Not using the Bundle or other device specific code within the custom views did NOT solve the problem. As described before I removed ALL custom code from the classes so that they where simple UIView subclasses without any changes.
So far nothing I tried had any effect. However, most answers I found are quite old. Are there are any new proposals to solve this issue?

Could not load NIB in bundle...MSSTabBarCollectionViewCell

I have a Swift iOS project and I installed MSSTabbedPageViewController using CocoaPods. I successfully:
Created an Objective-C Bridging Header
Made one of my ViewControllers a subclass of MSSTabbedPageViewController and implemented the required methods
But When I click the tab that is supposed to present the MSSTabbedPageViewController, the app crashes and gives me the error from the title of this question.
How do I fix this?

Static library, bundle and IB Designable

I'm trying to use the IB Designable and IB Inspectable in my UIButton but seems there are some errors.
In the Issue Navigator, the bundle file:
Storyboard :
IB Designables : Failed to update auto layout status: Failed to load designabled from path (null)
So I wonder if there are any configurations to do to use it in a static lib or something like that ?
This is
#import <UIKit/UIKit.h>
IB_DESIGNABLE
#interface CustomUIButton : UIButton
#property (nonatomic) IBInspectable int cornerRadius;
#end
My custom button I want to live render is inside a view controller
Unfortunately it isn't possible to use IBDesignables with static libraries (or static frameworks).
This isn't a great answer but I want to give some context on why.
It seems that the way Interface Builder loads classes to be shown as designables is by actually dynamically loading the dynamic framework that you create (and not your app's binary), and using the classes directly (after changing them using the Objective-C runtime quite a bit).
You can see that Interface Builder isn't loading your app, and just the individual frameworks with these steps:
Create a new Xcode project
Create a new framework target in the project
Add a class that is IBDesignable
In the storyboard from your app create a view and set its class to your framework's IBDesignable class
Click "Refresh All Views" in the "Editor" menu
In your DerivedData folder for the project, in the IBDesignables directory, you can see that only your framework target has been built.
Interface builder actually loads your framework using dlopen manually. You can also see that to facilitate this when building your framework, Interface Builder actually adds 2 RPATHs to your binary, so the dependencies can be found in the custom paths (you can view this with otool -L frameworkbinary). This method of loading your binary isn't possible with static libraries.
For what it's worth I think the best workaround for this is to build dynamic frameworks, instead of static libraries, but only for IBDesignable builds. You'll have to do some configuration work to do this, and it isn't easy to work around Xcode to have this work, but if you try it, you can use either the build path, or the environment, to differentiate IBDesignable builds vs "normal" builds.
EDIT: IB Designable and IB Inspectable do not seem to work with static libraries, so if you're using a static library, either consider using a dynamic framework (iOS 8 only) or move your component outside the static library, if possible.
For issues related with Cocoapods, use the following solution:
This is related to this question.
Here's the solution:
1) Install Cocoapods (0.36.0.beta.1) or newer;
2) Add use_frameworks! to your Podfile
See more here.

Storyboard crashes Xcode when opened

Whenever I attempt to open up my storyboard, Xcode crashes with the following error report
The funny thing is, the app works fine in the simulator and builds without errors. What is causing this crash? I see two possible crashes:
Exception reason: UITableView dataSource is not set
, but that shouldn't make the storyboard crash right?
Details: Failed to compute auto layout status IBLayoutConstraint, IBUIButton, IBUIDatePicker, IBUITextField, IBUIView, IBUIViewController, and IBUIViewControllerAutolayoutGuide.
Which doesn't give much information at all.
I have been using a storyboard with Xcode 5 for some time, so the question does not appear to be related to moving from Xcode 4 to 5. I can open the storyboard as XML and I can open my iPhone storyboard just fine.
If you are using git, I would recommend reverting to a time before this problem started.
If you are not using git, and you are absolutely sure you did not edit the xml for the storyboard then I would say:
1)find the storyboard file using the finder.
2)copy it to your desktop.
3)go back to Xcode and delete the storyboard from your project, select "move to trash". 4)re-import the storyboard file into your project.
Ive had similar problems with Xcode 5 and either reverting using git or the steps above usually get me back up and running.
Exception reason: UITableView dataSource is not set
Details: Failed to compute auto layout status IBLayoutConstraint, IBUIButton, IBUIDatePicker, IBUITextField, IBUIView, IBUIViewController, and IBUIViewControllerAutolayoutGuide.
The errors described above lead me to think that one if not all viewcontroller(s) for the items listed above lost their connectivity to viewcontroller.h / viewcontroller.m files. I would make sure you have everything wired up correctly, and you can check this by making sure the items in your viewcontroller have a circle in the gutter (next to the line numbers) that is filled in (solid) if the circle is not filled in then it means your items are not wired up to your viewcontroller. I would post a picture of your .h / .m file of your viewcontroller so we can further investigate.
I ended up copying each view controller scene (in XML) into a new storyboard. Some view controllers could not be copied without the storyboard crashing so I had to recreate about 4 of them, but by and large I got the majority of my work back.
What you need to do is reopen the project again in Xcode 5 and then go to the storyboard. Then at the right side choose for "Identity and type" and then set "opens in" to Xcode 4.6 to be able to open it in Xcode 4.6. And disable auto layout, somehow when you open it in xcode 5 it asks you to update it, I think you did that without a thought, happened to me as well :)

XCode 4 Won't Let Me Connect UITableView to its data source

For some reason, I am unable with XCode 4 to connect a UITableView to the File's Owner in the XIB file. This connection is something I have done countless of times.
The File's Owner is a class which derives from UITableViewController.
I even tried the following
1) Used Interface Builder from XCode 3 (still have it installed) and there I am able to connect it no problem
2) In a different project, with XCode 4 I put a UITableView in a view and was able to connect it to the File's Owner even though that didn't derive from UITableViewController or implemented the data source protocol
This problem is happening to a couple XIB files in this project. Note this project and those XIBs were created using XCode 3.
Is that a bug or I am missing something?
Instead of connecting your UITableView to your DataSource in Interface Builder, just connect it like so:
[myTableView setDataSource:self];
Turns out restarting XCode was the solution. Well perhaps restarting my system too since I did both.

Resources