Error After Duplicating Storyboard - iphone

Previously i had an existing iphone project.
Afterwards i want to create its iPad version so I duplicated the existing iPhone MainStoryboard to save my time, so I changed the line:
targetRuntime="iOS.CocoaTouch"
from the new storyboard (named MainStoryboard_iPad) to:
targetRuntime="iOS.CocoaTouch.iPad".
Finally I set Main Storyboard in iPad Development info to "MainStoryboard_iPad. But I don''t know why some how i got this error:
2012-10-11 13:28:07.852 CollViewSmpl[3170:c07] * Assertion failure in -[PSUICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:], /SourceCache/UIKit_Sim/UIKit-2372/UICollectionView.m:2249
2012-10-11 13:28:07.878 CollViewSmpl[3170:c07] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'could not dequeue a view of kind: UICollectionElementKindCell with identifier cellID - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
Anyone know what could cause this error and give me some workarounds? FYI, I use open source PSUICollectionView library inside the project in place of UICollectionView

That inconsistence error is because the storyboard source code were not being saved properly. Finally i created a new storyboard document targeted for iPad. I copied all source code of the preexisting iPhone storyboard and pasted them into the new one. I didn't forget to save the document (this is important) and gotcha, all the stuffs are now working very well.

Related

My app crashes and does not change views when I tell it to

My app crashes and does not change views when I tell it to. I have tried many other things but I can not get it to change programmatically for the life of me. I have attached my Workspace. Any help would be great!!!
Image
This code changes the view to this
self.messagesController?.setupNavBarWithUser(user)
How do I go to this view in my storyBoard correctly.
Here is my error code
2018-12-17 07:56:00.777229-0500 Kind Point[7129:524001] ***
Terminating app due to uncaught exception
'NSInvalidArgumentException', reason: 'Could not find a storyboard
named 'MessagesController' in bundle NSBundle
</Users/Jake/Library/Developer/CoreSimulator/Devices/C748FA7B-1F41-49C3-8A72-F3A39E494146/data/Containers/Bundle/Application/C824E34D-60DB-4CEC-8FEF-9BC939AF20C8/Kind
Point.app> (loaded)'
*** First throw call stack:
If you are using buttons, I suggest disconnecting the outlet/remove the segue from the button and re-add it.
Your terminal log says that there is no storyboard named MessagesController so, try adding a new view, or swift file and name it MessagesController. Add the messagesController to the view controller and see if it works.
To add a new view controller file to a storyboard, just copy and paste the code from one view controller and paste it to a new swift file. Then, change the name in the top of the code from ViewController, to the name of the view controller you want.

XCode is attempting to load a NIB file that I deleted from the project

I started working on a view with a NIB file and decided to delete it from my project to build it programatically. There are no mentions of the supposed call to the NIB file in any of my code and the .XIB doesn't exist anywhere in any of the application directories. Here's the exact error being thrown at me from the debug console.
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason:
'-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "GESplitMainViewController"
nib but the view outlet was not set.'
I cannot comprehend why the xcode is still attempting to load the NIB.
Firstly, the default implementation of initWithNibName:bundle searches the bundle for a nib that shares the same name as the view controller's class if you pass nil as the first parameter, which is why your app is trying to load one.
The fact that it is finding one is probably because the .xib you used to have in your project is still included in the bundle that the simulator is running. Xcode has a habit of leaving deleted resources in the simulator bundle even if you delete them from your project.
If you delete the app from the simulator, clean your Xcode project and run again, it should stop trying to load the nib.
Although this is the reason your app is loading from a nib, it is not the reason it is crashing. The crash is because the old .xib you were using didn't have a view connected to the view controller's view outlet.
If you have not used nib name anywhere in application, first delete application, clean your build and test it, hope this solves your issue..

IPhone app use core-plot (What to fix)?

i'm making iphone app that use Core-Plot chart. The app have "SavolaViewController as a main class that include a button and when button clicked it's GoTo to another class named "ChartViewController" by this code
ChartViewControllerVar = [[ChartViewController alloc]initWithNibName:#"ChartViewController" bundle:nil];
[self presentModalViewController:ChartViewControllerVar animated:YES];
I have read about core-plot for 4-6 hours and i have not understand any of the tutorials(it's not understandable) [({"Please dont answer with tutorial link"})]
I have coped the Core-Plot code from the example in Core-Plot .zip file(you'll find the code in the link bellow).
and i have this msg in the console
2012-07-15 16:38:31.325 Savola[13105:f803] * Terminating app due to
uncaught exception 'NSInternalInconsistencyException', reason:
'-[UIViewController _loadViewFromNibNamed:bundle:] loaded the
"ChartViewController" nib but the view outlet was not set.'
* First throw call stack: (0x140a022 0x19c2cd6 0x13b2a48 0x13b29b9 0x4102dd 0x410779 0x41099b 0x4199bc 0x414818 0x630565 0x417857
0x4179bc 0xca94792 0x4179fc 0x9a4f 0x3da5c5 0x3da7fa 0xc6f85d
0x13de936 0x13de3d7 0x1341790 0x1340d84 0x1340c9b 0x228f7d8 0x228f88a
0x349626 0x8c0a 0x2c55) terminate called throwing an exception(lldb)
What i want(If you can)
Fix the code to run in my app.
What does i need to but in the .xib file.
delete the codes unneeded.
The code
This has nothing to do with Core Plot. You have an IBOutlet in your .xib that's not connected properly.

Connecting a nib to files owner problem

So I am upgrading my iPhone app to be universal. I upgraded the project and than created a new nib for one of my classes. I set the custom class for that nib to my viewController and dragged the view from files owner to the nib. All worked fine. But than the second time I ran it, I got the following error:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the
"viewControlleriPad" nib but the view outlet was not set.'*** Call stack at first
throw:
So I disconnected view from the nib, than reconnected it and it worked. So basically the pattern seems to be every time I link it, it works once. This seems really weird. Thanks in advance for any help.
In the new XIB that is created I suppose you have not associated the class of the File's Owner with the class of the view controller
Also you have not set the view outlet of the File's Owner.
Hope you get it.
If you need more help than please let me know.
EDIT:
Please refer to this question:
Iphone sdk tabbar View outlet was not set
EDIT-2:
View Objects don't connect to the File's Owner
This happened to me before as well. It would be worth a try to try the following in this order:
Copy + paste your nib in xcode, rename the old one, name the new one to the old name
Rebuild the nib from scratch if it is not too much trouble
Restart your Mac
Examine the XML for the nib for any oddness
(#2 worked for me)

Trying to run a simple app with UITextField - Simulator is crashing

I have two UITextFields in the App as IBOutlets and I have made a connection from File's Owner to these ... When I run Build and Go, the iphone simulator crashes ... and in the console (after debugging) ... its showing me following ...
2009-08-22 18:11:40.869 Control_Fun[1138:20b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "Control_FunViewController" nib but the view outlet was not set.'
However, I am not having any outlet (IBOutlet) explicitly defined as view ... is this something hidden? When I Control Click File's Owner and drag it to the UITextFields, it giving me three options in the gray pop-up menu to connect to
1. nameField (declared as IBOutlet property in the header file)
2. numberField (declared as IBOutlet property in the header file)
3. view (where is this coming from?)
Thanks
Figured it out - It was a View-Based Application template from where I started so there was a parent View which was defined as a outlet (by default) and it still needed to be set (with File's Owner - in this case) ... working now.