ios - cellForRowAtIndexPath not being called - using tag to identify TableView -
I have seen many people who talk about the same thing but their answers to their questions are not my answers.
1) I have created a visual footage with an empty view controller. In that, I pulled a new table view (style plane) with a single-style solo prototype cell.
2) I am trying to learn about changing the behavior of tableviews dynamically, so I have an unstable array called section row, which will be the number of lines per section. At the moment, a single section with multiple rows will be an achievement :)
3) In my visual controller. I have set up delegates
@interface ViewController: UIViewController & lt; UITableViewDataSource, UITableViewDelegate & gt; @end
I have control in the view-controller yellow board from the tableview, it has been pulled - and the data source and representative outlet has been set.
4) In my view controller. , I have defined some global variables
@interface ViewController () {NSMutableArray * sectionRows; UITableView * myTableView; }
First of all, my data array (number of rows per section and second is a pointer to my table view, which I used to use a numerical view tag of '1' 5) In my opinion deedload, I start everything:
- (zero) viewDidoadload {[Super Viewedload]; MyTableView = (UITableView *) [self.view viewWithTag: 1]; SectionRows = [[NSMutableArray alloc] init]; // Create sectionwise [sectionRows addObject: [NSNumber numberwithIntagger: 1]]; MyTableView.dataSource = self; MyTableView.delegate = self; [MyTableViewReload Data]; }
As you can see, I also need to make sure that I reset the data source and the delegate but it has not made any difference.
5) I have overloaded 3 methods.
- (NSInteger) Talikadrishy: (UITableView *) Table View Snkyaofrojh Insaisn: (Ansaitiijir) section {Anselog (@ "Returning% @ rows" [Anubagaroobjektatindaks: section]); Return (NSIETGAR) [sectionRows ObjectTime: section]; // reference number in the array ...} - (NSInteger) numberOfSectionsInTableView: (UITableView *) Talikadrishy {Anselog (@ "% li to return to classes", sectionRows.count); Return section Rows.count; // sectionRows array size} - (UITableViewCell *) Talikadrishy: (UITableView *) Table View Selforaatindpath: (NSIndexPath *) indexPath {static NSString * CellIdentifier = @ "cell"; UITableViewCell * cell = (UITableViewCell *) [tableview dequeueReusableCellWithIdentifier: CellIdentifier]; // Configure cell ... if (cell == blue) {cell = [[UTitablesViews alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: CellIdentifier]; } Cell.textLabel.text = @ "xxx"; NSLog (@ "setting cell% @", cell); Return cell; }
Now, when I run this, I am getting back to NSLog, confirming that there is a block and a line:
2014-07 - 27 1 9: 58: 34.599 table details tests [12877: 60 B] 1 section returning 2014-07-27 19: 58: 34.600 Teblwutst [12877: 60 B] 1 back rows
However, you can not be called the cellarrowoutindexpath.
I have not seen anything about anything that I am doing wrong. What am I doing what I thought I had successfully worked in another simple project (to learn), but I should do more.
I'm missing everything
thanks
John
- (NSInteger) Talikadrishy: (UITableView *) table view Snkyaofrojh Insaisn: (Ansaiantijiar) section {Anselog (@" Returning% @ Lines ", [Anubagara Objektatindaks: section]) ; Return (NSIETGAR) [sectionRows ObjectTime: section]; // the number referenced in the array ...}
This is incorrect. Whatever you get from your array, it can not be entered in the NSInteger
. It is an indicator that you store NSNumber
s in the array:
- (NSInteger) table Views: (UITableView *) table view Snkyaofrejh Insashn: (NSInteger) section {NSLog (@ "Returning% @ Lines", [sectionRows Objektatindeks: section]); Return [[sectionRows ObjectTime: section] Integer value]; // the number referenced in the array ...}
Comments
Post a Comment