Tag: uitableview

Table View Cell AutoLayout in iOS8

I can’t seem to get AutoLayout working on my Table View Cells. On some cells it seems to work, and on others it seems to not work. Even cells of the exact same kind. For example, on some cells the Description will be more than 1 lines worth of text and it will work correctly… […]

How to disable a UITableView from scrolling up vertically?

I’m using EGORefreshTableHeader in conjunction with a static cell (defined in a nib) in a UITableView. I’d like to be able to scroll the tableview down to trigger the EGORefreshTableHeader and thus refresh the data in the static cell. BUT, as the static cell is sized to fit perfectly in the window, I want to […]

reloadData calls numberOfSections, numberOfRows, not cellForRowAtIndexPath

first of all sorry if this isn’t formatted correctly, first time doing this. I’ve been using stackoverflow to find help for a long time now and it’s been very helpful (thank you all), but this is the first time I’ve posted a question of my own. This question has been asked many times, but when […]

Adding UIViewcontrollers to UIScrollview

I am changing the layout of an existing application. There are a series of view which now needs to be added to a scrollview that the users can swipe to move to next screen. I have added the controllers to scrollview using the code below. This code is added in the viewDidLoad of the Viewcontroller […]

Add an action to a custom UITableViewCell

I am building a simple app with a table view filled with custom view cells and using a storyboard. I want to add a actions on the cell each time the user tap it. So far, I tried to create an IBOutle to link my cell to my tableViewController and add the action manually in […]

PullToRefresh TableView inside UIViewController

I’ve got a UIViewController which is also the UITableViewDelegate, amongst other things, for a UITableView, created in FirstView.xib @interface FirstViewController : UIViewController < UITextFieldDelegate, UITableViewDelegate, UITableViewDataSource > { UITableView *searchResults; // this is the property for the table view … } I want this table view to make use of PullToRefresh: https://github.com/leah/PullToRefresh, but the documentation […]

How to change Reorder Control image on ios 7

I’m looking for a way to change the reorder control image and size. I’ve using this code to change the reorder image: -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { for (UIControl *control in cell.subviews) { if ([control isMemberOfClass:NSClassFromString(@”UITableViewCellReorderControl”)] && [control.subviews count] > 0) { for (UIControl *someObj in control.subviews) { if ([someObj isMemberOfClass:[UIImageView class]]) { […]

Objective-C: How to list files from documents directory into a UITableView?

Below I have some code that lists files from my documents directory into a UITableView. However, the code is not correctly working and once I test on my device even though there is files in the documents directory, nothing is listed all displayed just displaying some blank cells. Here is the code I am currently […]

Can't draw in UITableViewCell's drawRect

I’m having trouble drawing in the drawRect method of my custom UITableViewCell. Here is the code I am using – (void)drawRect:(CGRect)rect { CGContextRef ctx = UIGraphicsGetCurrentContext(); CGPoint origin = _faceView.frame.origin; CGFloat width = _faceView.frame.size.width; CGFloat height = _faceView.frame.size.height; CGFloat border = 2.0f; CGPoint startPt = CGPointMake(origin.x + width/2, self.frame.size.height); CGContextBeginPath(ctx); CGContextMoveToPoint(ctx, startPt.x, startPt.y); CGPoint basePt […]

How to resign textfield as first responder in uitableviewcell

I use this code to resign my UITextField as firstResponder when using a standard UIView. But I now have UITextField in my UITableViewCell in a UITableView, and the code does not resign the textfield as first responder when I click outside of the textField. Any ideas how to make this work? – (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent […]