I have created a Custom View Controller with XIB file.
In XIB file, I put a tableview and a slider to the view and connect all of them as IBOutlet to the File's Owner.
I check the File's owner class and it is my custom class, so it's ok.
I double checked the view and slider are connected with File's Owner.
But when I try to load my custom viewcontroller, I got this error:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NoteController 0x6bd1da0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key _slider.'
Slider is my IBOutlet (which is connected to the view controller)
I found a lot of same problems on the internet, but all solutions not works for me :(
The load code:
NSArray *xibViews=[[NSBundle mainBundle]loadNibNamed:#"PopoverSetFont" owner:self options:nil];
What should I try?
After 2 hours, and when I ask this question, found a problem. I do not delete a question, I share it, I hope it helps.
So instead of the [[NSBundle mainBundle]... line, use this for load:
PopoverSetFont *popoverView=[[PopoverSetFont alloc]initWithNibName:#"PopoverSetFont" bundle:nil];
Related
I am using Daniel Gindi's Charts library.
I have a ViewController in my app that is a scrollview, and it is supposed to display 4 line charts on different axes (i.e they are in different UIViews), and because the lineCharts themselves are quite big, I put them in a ScrollView to ensure that the graphs can be seen clearly.
Before connecting the UIView to the ViewController, the app works fine. I could scroll the page as expected, and also the LineChartView looks fine, it just displays "No Data to Show"
However, I realised my app crashes after trying to debug my failing ViewController. I realised I could not even add the IBOutlet for the LineChartViews into my ViewController. I tried it with one and it gives an NSUnknownKeyException, and the problematic part of the code is the IBOutlet. I have made sure all my connections are clean, in fact I rebuilt the storyboard to make sure everything was fine and it still crashes when I establish an IBOutlet.
There isn't much code involved as it just involves establishing an IBOutlet with the relevant ViewController. I saw in another post that adding chart.translatesAutoresizingMaskIntoConstraints = false might help and it did not.
The error is:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key chiller1Trend.'
You cannot use chiller1trend as anIBOutlet and as a Cocoa binding key. You need to do one thing or the other, not both, because if you use bindings you don’t need that outlet. Thus, either remove that outlet from the view controller class code or select the UIControl to which chiller1trend is bound in the bindings inspector in your storyboard or xib file and delete that Cocoa binding. Do not forget to check if the module of your controller is also well set.
I am writing a very simple app with just one view controller. However I am getting an exception:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key
Here is what I did:
added a UIImageView and created an outlet in the code by ctrl-dragging to the assistant editor.
deleted the UIImageView cause I don't need
deleted the outlet property from the code
checked the connection inspector and removed the outlet from the storyboard/InterfaceBuilder.
But I am still getting the exception as listed above, could anyone give me some hints?
Usually you should do a clean of your project, found in the Project menu next to build That way xib files get recreated and often such errors disappear.
SO, I have a property to a UICollectionView Object
#property (strong, nonatomic) IBOutlet UICollectionView *collectionViewVARIABLE;
I held control and dragged the mouse, it's all linked up.
my problem is that it doesn't seem to actually work.
I try calling
[self.collectionViewVARIABLE registerClass:[MFH_mainfeed_CondensedViewCell class] forCellWithReuseIdentifier:#"MainIpadFeedCell"];
I get this error:
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'could not dequeue a view of kind: UICollectionElementKindCell with identifier MainIpadFeedCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard'
If I put this call within cellForItemAtIndexPath using collectionView instead of the variable, it works.
I've tried the following on a button click, also nothing.
self.collectionViewVARIABLE.backgroundColor = [UIColor blackColor];
I have been at this for three days. My head hurts. Can somebody please tell me what I am missing.
So i started with my app with 2 buttons in my calenderview : a day and a week button.
Now i want to just use 1 button and dynamically change the name of it (that part works)
I am using the weekbutton for that. But now I want to remove the day button.
But i cant get it out of my program.
I tried first deleting the link in .xib
Then i delete the button.
Then i remove it from the .h file, and then from .m
It always results in the same error :
* Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key dayButton.'
Cant see why i just cant remove the button...
You`ve deleted outlet from code .h/.m file, but somewhere in .xib something is still connected to deleted outlet. Recheck all connections in .xib file to be sure that they have appropriate declaration in .h file.
I'm new to IOS and I'm stuck with an error I added a table view in my storyboard named timelinetable and after some time I deleted that from my storyboard but after that when debugging it shows an error
Terminating app due to uncaught exception 'NSUnknownKeyException',
reason: '[ setValue:forUndefinedKey:]:
this class is not key value coding-compliant for the key
timelineTable.'
but I cant find anything named timelinetable in my project so how can I fix that problem
Go to the xib
click on files owner and click on the show connection inspector button (last one ).
Check out all the connections . The problem is due to you are referencing the outlet which is no more exist.
you connect an outlet and you then remove the controller without removing its outlet.