Table View cellForRowAtIndexPath warning
Just add the declaration of implementing UITableViewDataSource protocol to the class definition like this:
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {}
UITableView method cellForRowAtIndexPath not called
Got it!
Had the same problem - I also have added a tableview into a uiviewcontroller and it also not worked, but I know the problem now.
If you add the tableview on interface builder AND click after that "Add Missing Constraints", it'll add constraints that can't work together.
At my position I had the tableview on my whole uiview and after click on "Add Missing Constraints", it will add this here:
And now if you delete one of the Trailing or Leading Alignments, it will work - cellforrowatindexPath will get called! Don't know why it is like that, but it will work.
Hope I can help you.
UITableViewDelegate cellForRowAtIndexPath not called
cellForRowAtIndexPath may not be called because one(or more) of the following reasons:
- numberOfRowsInSection returns 0
- numberOfSectionsInTableView return 0
- dataSource not properly set
- heightForRowAtIndexPath returns 0
- table has frame size of 0 for height and/or width
In your case my best shot is number 1(place a breakpoint in the method to see how many rows you are returning when table ask for rows count). My worst experience was with debugging number 5 :)
table view Warning
tableView:accessoryTypeForRowWithIndexPath:
is deprecated in iPhone OS 3.0 with the following note:
Use the accessory-view and accessory-type properties (for both normal and editing modes) of the UITableViewCell class when configuring table-view cells.
They mean you should set accessoryType/accessoryView properties in tableView:cellForRowAtIndexPath:
instead.
Incompatible pointer types warning with custom UITableViewCell
I'm not 100% sure but did you try casting the cell?
UserFavoriteCell *cell = (UserFavoriteCell *)[tableView cellForRowAtIndexPath:indexPath];
warning in uitableview
Do exactly what the warning message says: remove the implementation of tableView:accessoryTypeForRowWithIndexPath:
and set the cell's accessoryType
and editingAccessoryType
in tableView:cellForRowAtIndexPath:
instead.
Related Topics
Swift 3 Warning: Non-Optional Expression of Type 'String' Used in a Check for Optionals
Swift Optional Type: How .None == Nil Works
How to Save a Custom Class as an Attribute of a Coredata Entity in Swift 3
Calculate the Number of Dimensions of a Multi-Dimensional Array in Swift
Swift - Encode and Decode a Dictionary [String:Any] into Plist
Swift Error: 'Sequence' Requires the Types 'T' and 'Arrayslice<T>' Be Equivalent
Stack Overflow When Defining Subscript on Ckrecord in Swift
Googlesignin - Always Return "The User Canceled the Sign-In Flow." in iOS 11
Xcode: Using Custom Fonts Inside Dynamic Framework
Load Image from Url on Watchkit
How Set Custom Fonts for iOS13 Context Menu Actions
Understanding Singleton in Swift
Why Strings Are Not Equal in My Case
MAC App to Switch Between /Etc/Hosts Files, How to Allow Access
The Right Place to Call .Removeobserver for Nsnotificationcenter = Swift Deinit()
How to Draw Dashed Line in Arkit (Scenekit) Like in the Measure App