NSTableView setRowSizeStyle - objective-c

I guess setRowSizeStyle is supposed to change the font size of my NSTableView, and make everything smaller.
Is this correct ?
- If so, of you know an alternative method for Leopard ? (prev OSX 10.7)
If it is not correct, what could I use instead ?
thanks

No, setRowSizeStyle method is used to define the size of the rows in the table view. for font size refer https://stackoverflow.com/q/8257631/944634.

Related

How to make a row in UITableView invisible?

I'm very new to this field...I'm using a UITableView to create a table in my apps..but based on some certain checks, I need to make some of the rows invisible...how can I achieve that??
To accomplish this, you simply have to change the UITableViewCell itself. But I don't really know, whether this abides by Apple's HIG (Human Interface Guidelines). Maybe you should consider to remove the cells at all and if you do need them again, add them?

Resize UIFont Size

I'm using the OHAttributedLabel as an UILabel replacement.
I'd like to calculate the size of my UIFont relying on the length of the text and the height of the OHAttributedLabel.
label.adjustsFontSizeToFitWidth = YES; doesn't work, OHAttributedLabel doesn't support it and I don't know how I could fix it.
Is there any way to calculate the size of the font?
Thanks in advance,
Nicolai
A potentially simple solution is to use the TTTAttributedLabel library instead of OHAttributedLabel. It supports the adjustsFontSizeToFitWidth property as long as the number of lines is set to anything greater than 0.
If you need something from OHAttributedLabel that TTTAttributedLabel doesn't provide, perhaps the source can give you some ideas on how to implement it.

The correct way to user custom UITableViewCells

I have seen a lot of different ways of implementing custom cells in a table view.
Like different file owners, get it from bundle and call the the latest obj of the array and a lot more.
But all did not feel right.
What is the best and correct way to create and use custom table view cells (with interface builder).
I think Storyboards are the new proper way. I use this method:
http://iphonedevelopment.blogspot.com/2009/09/table-view-cells-in-interface-builder.html
And it works quite well. I think it's somewhat proper in that you are asking the OS to do most of the work, although it's a little sneaky that the cell is assigned to a property as part of the NIB loading as a side effect.
Had the same problem. For me it is now solved with storyboards in ios5.

Attributed strings in UITableViewCells without WebView?

does anyone know if there's a way in with 3.0+ to display attributed strings within a UITableViewCell without using a UIWebView for that? I need to display a string with linked, tappable substrings as the typical detailTextLabel. I wouldn't mind exchanging this UILabel against another type of view, but I think a UIWebView could be just too slow when rendering a table with hundrets of cells. Or does someone have opposite experiences here?
So my question is: what's the best way to achieve mixed strings in a very large table without a great performance hit?
I searched for this almost a whole day now, but I can only find old posts mentioning that there's no attributed string on the iPhone (outdated, as this was pre-3.0) and/or saying that they use a UIWebView for that. But really, I don't think this would perform very well on large tables, would it?
Many, many thanks in advance
Arne
NSAttributedString has valid use only since 3.2.
But you may use TTStyledTextLabel from three20.
You can create your own view and put it in the cell.
Have a look at Apple doc related to UITableView, I linked the section "A Closer Look at Table-View Cells" which has lots of examples how to modify UITableViewCell.

Can't make empty selection in NSTableView

I don't know how it happened, but all of a sudden in my table view I can't make an empty selection anymore. Like a table view row always has to be selected, and it can't be deselected by clicking somewhere else in the table view. I can select a different row, but I can't make an empty selection.
In the Interface Builder attributes for the table view empty selection is enabled, so I don't know where to look next. The one major change I made was that I installed OS X Snow Leopard. I'm not sure if this issue has something to do with that.
Thanks
I struck this exact same issue (I am using XCode 4.2 but compiling against the 10.6sdk). NSOutlineView::deselectAll just was not deselecting things. I have a fairly complex NSOutlineView which exhibits the same behavior. I had a look on the apple developer forums and other places to try and work around this issue. However in the end working around this for me was very simple and I could just use:
- (void) myDeselectAll
{
[self selectRowIndexes:[NSIndexSet indexSet] byExtendingSelection:NO];
}
Try doing it programmatically with the setter method setAllowsEmptySelection:. Alternatively, try disabling empty selection in IB, saving, then enabling it, saving one more time. That might fix it.
Also make sure that something in tableView:shouldSelectRow: isn't stopping you from it (provided you've implemented this delegate method).
This is a bit old, but for those who need an answer to this:
Use the interface builder and mark the array controller. remove checkmark "avoid empty selection".
If not done so, create an outlet for the array controller. Here I have called it DocumentArrayController.
then to empty selection:
[_DocumentArrayController removeSelectionIndexes:
[_DocumentArrayController selectionIndexes]];
Do you have your columns bound to an array controller? If so, check the controller's attributes.
I'm not allowed to say much more than this: It seems to be a problem with 10.6 specifically