• Register
search
Log In
0 votes
319 views

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 284 views
284 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 20 views
20 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 178 views
178 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 31 views
31 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
1 vote
2 answers 37 views
37 views
Problem : I have very recently purchased my new iPhone. Now want to sync my iphone with the itunes. But I keep on getting below error : Itunes could not connect to this iphone. you do not have permission. I have also tried to read some of the solutions on it of ... I have spent lot of time in fixing above error but unable to fix it as of now so looking for expert help in fixing above error.
asked Apr 21 stewart 4k points