• Register
0 votes
753 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 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 721 views
721 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 83 views
83 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, 2020 mphil 2.3k points
0 votes
1 answer 254 views
254 views
Problem: I am trying to archive my project but facing very unexpected error as shown below: Showing Recent Messages:-1: mkdir -p /Users/spritzindia/Library/Developer/Xcode/DerivedData/Contigo-atftiouzrdopcmcpprphpilawwzm/Build/Products/Debug-iphonesimulator/Contigo.app/Frameworks Showing ... : pod 'IQKeyboardManagerSwift'  pod 'SDWebImage', '~> 4.0'  pod 'KRPullLoader'  pod 'Paytm-Payments'
asked Aug 25, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 579 views
579 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
0 votes
1 answer 5 views
5 views
Problem: development cannot be enabled while your device is locked.
asked Feb 18 charles mathews 3.8k points
0 votes
1 answer 4 views
4 views
Problem: itunes was unable to load dataclass information from sync services.
asked Feb 13 Shovo210 2.3k points
0 votes
1 answer 7 views
7 views
Problem presenting view controllers on detached view controllers is discouraged
asked Feb 11 charles mathews 3.8k points
1 vote
1 answer 551 views
551 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, 2020 Martin K 6.6k points
0 votes
1 answer 6 views
6 views
Problem: initializer for conditional binding must have optional type.
asked Feb 17 charles mathews 3.8k points