• 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.9k points

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.

36.1k points

Related questions

0 votes
1 answer 355 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
1 answer 21 views
Problem : I am currently facing below error in my iPhone: “The maximum number of free accounts have been activated on this iPhone”. To fix this problem I even tried to erase all content and settings of the iPhone and after that set it as the fresh new iPhone. But I am still facing the above problem. How can I fix my iPhone now?
asked Feb 28 mphil 2.3k points
0 votes
1 answer 233 views
Problem : I am trying to present the view controller as the pop over if the user successfully resets their password. Basically, if all is ok with emailing the password reset instruction email then the below code will run. ... .Popover let mypopover = mynavController.popoverPresentationController popover?.delegate = self self.presentViewController(mynavController, animated: true, completion: nil)
asked Dec 27, 2019 alecxe 7.5k points
1 vote
1 answer 53 views
Problem : I am very new to Swift. Now I have started learning Swift. Recently I have written very simple class as shown below for your reference: public class SwiftUser {     let userid: Int     let userfirstName: String     let userlastName: String     ... Return from initializer without initializing all stored properties . Now I am very confused. Please help me in resolving above Swift error.
asked May 12 Martin K 6.6k points