• Register
0 votes

Problem :

Facing following Swift issue
must register a nib or a class for the identifier or connect a prototype cell in a storyboard
6 5 3
6,930 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

You can register a class easily for your UITableViewCell as following:

Swift 3+:

self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell")

Swift 2.2:

self.tableView.registerClass(UITableViewCell.self, forCellReuseIdentifier: "cell")

Please make sure the same identifier "cell" is also copied at your storyboard's UITableViewCell.

The "self" is for getting the class and use the class name followed by .self.

9 7 4
38,600 points

Related questions

0 votes
1 answer 4 views
Problem: Whenever I try to run my app in Xcode 6 Beta 4 I am getting the error: The file "MyApp.app" couldn't be opened because you don't have permission to view it.
asked Apr 11 ummesalma 29.2k points
0 votes
1 answer 9 views
Problem: I am getting this warning from the storyboard - prototype table cells must have reuse identifiers. I have renamed the identifier in the attributes inspector but it does not seem to have removed the warning. Any suggestions?
asked Mar 31 ummesalma 29.2k points
0 votes
1 answer 7 views
Problem: Why I got the error >Could not load the image referenced from a nib in the bundle with identifier
asked Apr 30 ummeshani 10.8k points
0 votes
1 answer 845 views
Problem : I got an error on Xcode saying that there was no information about the view controller as follows: Could not insert new outlet connection: Could not find any information for the class named Why am I getting this error?
asked Nov 28, 2019 alecxe 7.5k points
0 votes
2 answers 7 views
Problem: Initializer for conditional binding must have Optional type, not '() -> String? How to treat this error? Code: func loadViewFromNib() -> UIView? { let xibName = getXibName() let bundle = Bundle(for: type(of: self)) let nib = UINib(nibName: xibName!, bundle: bundle) return nib.instantiate( withOwner: self, options: nil).first as? UIView } func getXibName() -> String? { return nil }
asked May 1 ochena 23.3k points
0 votes
1 answer 2 views
Problem: I've seen this Q/A What triggers, but it's not what I want. I also read this Network privacy permission check, but there is no answer. I also search for any methods or classes which can help me here: Network, but no luck again. There is a ... this popup and how to check is access granted or not(for example in AVCapture, I can check the authorization status for AVMediaType). Thank you!
asked May 4 anika11 32.2k points
0 votes
1 answer 3 views
Problem: I would be glad if I get some tips on this > Class appdelegate: uiresponder, uiapplicationdelegate {
asked 2 days ago Junia Phoebe 15.3k points
0 votes
1 answer 5 views
Problem: Is there a way to solve > Itunes is currently downloading software for the iphone progress
asked May 4 ochena 23.3k points
0 votes
1 answer 5 views
Problem: I was using my iPhone 6S suddenly it's restarted and stuck on the white logo and going to restart again and again. I went to recovery mode and installed the latest version of iTunes for Windows 10 and trying to update and restore it but in both ... not a device this instance is tracking (is actually com.apple.mobile.restored). Move along, move along. Any help highly appreciated..!
asked May 3 muktaa 34.6k points