Mac Cocoa |
Author |
Message |
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat May 02, 2009 1:43 pm Post subject: TableViews |
|
|
iphonedevsdk.com - UITableView with lots of cells (+1000)
"Curious does anyone have any good ideas/best practices for how to use
UITableViews with lots and lots of cells?" |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Sun May 10, 2009 6:14 pm Post subject: |
|
|
SO - What are your favourite UITableView / UITableViewCell tricks?
"To ensure good performance scrolling, it's important to avoid transparency
in any element if possible - so if you are creating custom cells make them all
opaque and set the backgrounds correctly." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Jun 01, 2009 12:22 am Post subject: |
|
|
so - More than 1 rightBarButtonItem on navigation bar
"My suggestion would be to not implement the Add functionality as a button
in the navigation bar. I assume that you're dealing with a table view of items
below, so one way of handling this user interaction is to display an "Add new
item" option as the last entry in your table view." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue Jun 02, 2009 1:35 pm Post subject: |
|
|
MF - Resizing UITableView When In Landscape
"You need to set the autoResize flag of the tableview to flexible height and
flexible width. Then it will resize whenever its parent view resizes." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Sep 14, 2009 12:07 am Post subject: |
|
|
MF - Image Persistence In UITableViewCell
"Each time the animation occurs the tableview is reloaded. but sometimes
when the app is in state A and the tableview animates back onto the screen,
all of the cells with buttons that completely fit in the tableview are of the cor-
rect red color except for the last cell, which is only partially visible and most-
ly outside of the scroll area is green. however, the last cell's wrong color on-
ly lasts for a second, quickly switching to the correct color." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sun Sep 20, 2009 1:40 am Post subject: |
|
|
MF - Custom table cells
"... in that table cell I have a label on the bottom. I want to resize the whole
cell and the label if there is too much text to fit. Text is loaded from an NS-
Array. But I don't know how the resize the cell and the label so that the text
can fit." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sun Sep 20, 2009 2:27 pm Post subject: |
|
|
MF - Restoring state to a navigation controller with table views
"Take a look at one of Apple's apps (like Mail) that restores state across a
Navigation Controller. If you start your app on a leaf controller and you pop
back to a table view, the "selected" table cell de-selects, as if it was select-
ed to push you to the leaf in the first place." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Sep 21, 2009 12:51 am Post subject: |
|
|
iphonesdkarticles.com - Drill down table view tutorial
"Using a drill down table view we can display some primary level of items,
where a selected row will result in displaying a new table view with data
related to the item selected. The process is repeated until an item has no
sub level categories and it is then we display a detail view which is not a
UITableView." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Nov 11, 2009 4:38 pm Post subject: |
|
|
MF - Table doesn't Scroll Programmatically
"I need on button clicking to scroll table programmatically. But the following
code does nothing..." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat Apr 03, 2010 12:21 am Post subject: |
|
|
Michael Tyson - Easy rounded corners on UITableViewCell image view
"Here’s a relatively easy way to achieve rounded corners on the standard
image view in a UITableViewCell:
cell.imageView.layer.masksToBounds = YES;
cell.imageView.layer.cornerRadius = 5.0;
Set this up when you create the cell." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Fri Apr 23, 2010 11:47 pm Post subject: |
|
|
Jeff LaMarche - Table View Cells Redux
"It's really, really easy to forget that step, and the code works perfectly fine
if you do forget, you're just eating memory and getting poorer performance
than you should. Unless you profile your apps or test with very large data
sets, you could very well ship your app like this and not even realize it." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sun May 23, 2010 6:53 pm Post subject: |
|
|
MF - How to show a light reasonable cell selected image / color?
"If you want to customise the selected background colour it is possible, just
rather more involved than you might like (see the SELOC Tech Wiki app in
my signature for example: it uses UITableViews a lot with customised colo-
urs: my selected highlights are green)." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon May 24, 2010 11:31 pm Post subject: |
|
|
Jeff LaMarche - Downloading Images for a Table without Threads
"I've written a small iPhone app that downloads images from Deviant Art.
You just enter somebody's Deviant Art username into a text field and the
application will grab the the images in that person's gallery, download them
asynchronously, and display each one in the table once it's finished down-
loading." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sun Jul 18, 2010 9:52 pm Post subject: |
|
|
so - How to set a gradient UITableViewCell background?
"I would like to create a gradient UITableViewCell background like the de-
fault Clock app that comes on the iPhone. I am not exactly sure how to ac-
complish that." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Oct 31, 2011 9:13 pm Post subject: |
|
|
Looks like -indexPathsForVisibleRows may return an array even when there
are no cells at all in the table, so this code is SIGABRT waiting to happen:
Code: | NSArray *cells = [self.tableView indexPathsForVisibleRows];
if (cells) |
It is better to do this:
Code: | NSArray *cells = [self.tableView indexPathsForVisibleRows];
if (cells && [cells count]) |
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sun Mar 18, 2012 1:48 pm Post subject: |
|
|
bnr - Entering Editing Mode via swipe
"// The willBegin/didEnd methods are called whenever the 'editing' property
is automatically changed by the table (allowing insert/delete/move). This is
done by a swipe activating a single row"
bnr - Handling "swipe to delete" mode
"Turns out that we need to modify setEditing:animated: when we use a
navigationItem" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu Jan 10, 2013 9:09 pm Post subject: |
|
|
cocoanetics.com - Expanding/Collapsing TableView Sections
"The eye of the experienced developer sees two challenges contained
therein: 1) grafting a mechanism for collapsing and expanding onto
UITableView in a reusable way 2) making custom accessory views that
look like a rotated version of the disclosure indicator, pointing upwards
or downwards and also changing color when highlighted."
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Tue Dec 24, 2013 4:22 pm Post subject: |
|
|
so - Change background of a grouped UITableView
"This usually works on every other UITableView, but not the one with groups,
is there something else I have to do? In IB I have the background color set
to a clear color, but that doesn't do much."
"A: You additionally need to disable the background view of tableView." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Tue Dec 24, 2013 10:20 pm Post subject: |
|
|
so - iOS 7 TableView like in Settings App on iPad
"I want to have a group UITableView with the style same like the iPad
Settings application Detail view for iOS 7. It is a tableView with rounded
corner. Please check the attachment for details." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Tue Dec 24, 2013 10:22 pm Post subject: |
|
|
so - IOS7 UITableView grouped like in Settings App
"There is a much simpler way to achieve this.
• Place your UITableView away from the sides. eg: using Autolayout you'd
have a leading and trailing space of 15px (or whatever you want). You're
now creating the 'indentation' that Apple used to give you for free with
grouped table views.
• Adjust the layer to add corners and a border" |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Tue Dec 24, 2013 10:25 pm Post subject: |
|
|
so - iOS7-UItableViewCell display in a table view with style Grouped
"This solution will work for iOS7, as well as previous versions of iOS.
Create a custom UITableView cell class and override UITableViewCell. In
setFrame you can adjust desired cell size. Both setFrame and setAlpha are
called after tableView:willDisplayCell:forRowAtIndexPath: so any accessory
views and image views display correctly." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat Oct 22, 2016 6:17 pm Post subject: |
|
|
so - View based NSTableView editing
"By default, each cell (instance of NSTableCellView) has an NSTextField
sitting on it. When you're editing the cell, what you're in fact editing is this
text field. Interface Builder makes this text-field non-editable"
so - Having a UITextField in a UITableViewCell
"I'm trying to do that for a couple of days now, and after reading tons of
messages of people trying to do that too, I'm still unable to have a fully
working UITextField in some of my UITableViewCells..."
"Basically we take the stock UITableViewCellStyleValue1 and staple a
UITextField where the detailTextLabel is supposed to be. This gives us
automatic placement for all scenarios: iOS6/7/8/9, iPhone/iPad, Image/
No-image, Accessory/No-accessory, Portrait/Landscape, 1x/2x/3x."
so - NSTextField in NSTableCellView
"I have a view based NSTableView with a custom NSTableCellView. This
custom NSTableCellView has several labels (NSTextField). The whole UI of
the NSTableCellView is built in IB."
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
Posted: Tue Apr 10, 2018 8:59 pm Post subject: |
|
|
Karen Grigoryan - Creating a settings screen using UITableViewController
"The solution is so simple, I can't believe I figured it out only now, after two
years of doing iOS programming.
You create a UIViewController and a UITableViewController. Then you put your
UITableViewController inside your UIViewController, as a child view controller.
That's it." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3136 Location: Europe
|
|
Back to top |
|
|
|