[Solved] How to refresh a uitableview?

There are several well known methods for refresh the UITableView. -reloadData – this method totally refreshes the whole table view, by keeping the current row position on the screen. However, this works not very beautiful and there are two other methods -reloadSections:withRowAnimation: – you can call that method with one of UITableViewRowAnimation enum type to … Read more

[Solved] Radio button inside the UITableview not working

create the one int value int selectstr; UIButton * button; – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @”cell”; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:nil]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] ; } UILabel * title = [[UILabel alloc] initWithFrame:CGRectMake(50.0, 14.0, 215.0, 36.0)]; title.backgroundColor = [UIColor clearColor]; title.textAlignment … Read more

[Solved] How to get index of array element in cell? [closed]

Sorry if I’m understanding your English incorrectly, but I guess this is along the lines of what you want: You can get the indexPath of the row that was selected in a table by implementing tableView:didSelectRowAtIndexPath: in you tableView’s delegate (presumably your tableViewController). An indexPath has two properties you’ll be interested in; section and row. … Read more

[Solved] UITableView crashing on scroll

Bind UITableView properly in XIB. and right following code. – (void)viewDidLoad { [super viewDidLoad]; self.tableView.separatorColor = [UIColor clearColor]; } – (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } – (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 3; } – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @”Cell”; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) … Read more

[Solved] -[__NSArrayI length]: unrecognized selector sent to instance 0x7f1e9f90

From the NSLog it seems like your array contains another array in it and that inside array has the elements that you want to show in your tableview. So change: cell.phoneLbl.text = [array6 objectAtIndex:indexPath.row]; to: cell.phoneLbl.text = array6[0][indexPath.row]; 4 solved -[__NSArrayI length]: unrecognized selector sent to instance 0x7f1e9f90

[Solved] Two different heights for sectionHeaderView

Your code is wrong try this: – (CGFloat)tableView:(UITableView *)tableView heightForViewForHeaderInSection: (NSIndexPath *)indexPath { if(indexPath.section == 0) // First section { return 300; } else if(indexPath.section == 1) { // Second return 50; } else { // Any other section return 40.0; // Default } } 1 solved Two different heights for sectionHeaderView

[Solved] JSON to UITableView error

objectAtIndex is a method for NSArray. Your Menu object is an NSDictionary. You need to get the array within the Menu dictionary like this: NSArray *myArray = [Menu objectForKey:@”GetMenuMethodResult”]; and use myArray as the source for your rows. 0 solved JSON to UITableView error

[Solved] Refactoring UITableView delegates for iOS7 and iOS8

self.tableView setDelegate: assigns a weak reference; if you don’t hold your own reference to this object, it will get collected. This is why you’re seeing the crash. The system has collected the memory that was assigned to your delegate, then reassigned the memory to an NSArray. Your table tries to call methods on the delegate … Read more

[Solved] Refresh or reload data in function ViewWillAppear not always working in UITableViewcontroller

There are two things you should consider. First reload data will be called right away after reloadTransaction() if your url request hasn’t processed yet, it will show an empty tableView. Second, when you have new data make sure to call the main thread before you call self.tableView.reloadData(): internal func reloadTransaction(){ self.transactionList.removeAll() //get URL response and … Read more

[Solved] Populating a UITable with NSDictionary in SWIFT

Here’s what you’ll need to do: First, create a class variable for your data. Put this under your class declaration: var dataDict: [String:AnyObject]? Then, to keep things organized, put your tableView property and your userDetails property directly under the dataDict. @IBOutlet var tableView: UITableView! let userDetails: [String] = UserDefaults.standard.stringArray(forKey:”UserDetailsArray”) Now, your viewDidLoad method should look … Read more