nstableview

View based NSTableView EXC_BAD_ACCESS on Lion with ARC

别等时光非礼了梦想. 提交于 2019-12-04 09:08:45
This is weird. I've got a super simple project to learn NSTableView, and it's set up in my nib, set as a View-based tableView. I've also set the dataSource and delegate to my controller obejct. When I do this, however, and run, I get an EXC_BAD_ACCESS, with the trace starting in my main function and the rest of the stack is internal to Cocoa (so not my code). There's really nothing fancy going on, other than this project is using ARC (it's a new project, so this was the default). I also tried using the Analyzer to make sure I wasn't improperly doing memory managment anywhere and there were no

Parse Data into NSTableView

旧巷老猫 提交于 2019-12-04 08:42:38
问题 Hello fellow programmers, First off, I am new to OSX/iOS programming and am trying to learn swift. I am fairly competent in java and wanted to teach myself something new. I am aware that the swift programming language is in it's early stages. I have a table using the parse.com data browser. I can get the elements from that table and store them in an array. Normally, in java, I would then simply iterate over those elements and populate a JTable. Now, my question to you is...How would I go

Swift & NSTableView - Simply select a row

假如想象 提交于 2019-12-04 08:26:03
I'd like to programatically select a row in my NSTableView, with just one column. func selectColumnIndexes(_ indexes: NSIndexSet!, byExtendingSelection extend: Bool) I have been playing around with this, but I am not sure how to write "Select row #2". Do I have to start with the variable connected to the @IBOutlet of my Table View? I have to indicate it is about my NSTableView somehow. Thanks! Swift 4 Solution I created an extension to make a little easier to do this. Also if you implemented a click action on the table view cell this will invoke it as well extension NSTableView { func

Creating a custom title bar on a standard NSWindow

风格不统一 提交于 2019-12-04 07:55:48
问题 I've been trying to build a specific look for my menubar app. I've been using a NSWindow with a NSBorderlessWindowMask style mask and setting [window setOpaque:NO] and [window setBackgroundColor:[NSColor clearColor]] . That gives me a blank canvas which works great for the title bar. Now I'm having problems with the view-based NSTableView I'm using for the listing. How can I clip the NSTableCellView s to the window's rounded corners? I started out just having a custom view wrapping the

How to trigger an action from a NSTableCellView in view based NSTableView when using bindings

雨燕双飞 提交于 2019-12-04 07:54:58
I'm facing a problem with a view-based NSTableView running on 10.8 (target is 10.7, but I think this is not relevant). I'm using an NSTableView, and I get content values for my custom NSTableCellView through bindings. I use the obejctValue of the NSTableCellView to get my data. I added a button to my cell, and I'd like it to trigger some action when clicked. So far I have only been able to trigger an action within the custom NSTableCellView's subclass. I can get the row that was clicked like this, using the chain: NSButton *myButton = (NSButton*)sender; NSTableView *myView = (NSTableView*

View based NSTableView selection highlighting

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 07:49:31
I am trying to port an iOS application onto the Mac and I came across a couple of issues during the transition. One of them is the customization of NSTableView . What exactly is the difference between NSCell , NSTableRowView and custom NSView based NSTableview ? I initially started out with a view based NSTableView , but I soon noticed that I would have to handle the selection myself. I could not pull that off, so I went on to use NSTableRowView , which, strangely, does not call the initialiser of my custom NSTableRowView . I basically just want a custom table view cell with custom contents,

Core Data Image Won't Load Into NSTableView Image Cell

久未见 提交于 2019-12-04 06:10:09
问题 In my code I am storing an image into my Core Data model (works fine). If I set up my view to have an NSImageView and bind its Data to Controller Key: selection and modelKeyPath: myImagePath, it works. It will show each image for the selected row. I then create a new column in my NSTableView and drag an image cell onto the column. However, I cannot get my Core Data bindings to have the image show up in the cell. I have tried binding both value and data, but no luck. Since I am sure the image

How to invert text colour of selected NSTableView row

廉价感情. 提交于 2019-12-04 06:05:56
I have an NSTableView in which I'm changing the colour of the text in a particular column, but when a row is selected, the text does not change to a more appropriate colour so that it's readable. Finder's Date Modified, Size, and Kind columns have grey text, and when you select a file/folder row, the grey text changes to white (so that it's readable within the blue highlight). I can't find a magic checkbox on XCode to enable this behaviour by default, so does anybody know how I might achieve the same effect? I'm using Swift in XCode 6.3. Thanks. You don't say what view or view hierarchy you're

NSTableView: blue outline on right-clicked rows

强颜欢笑 提交于 2019-12-04 05:52:10
I'm wondering how I can get rid of the blue outlines that Cocoa draws around rows in NSTableView / NSOutlineView when right-clicking on them. NSTableView Outline http://tobidobi.com/nstableview_outline.png It doesn't seem to be a classic "highlight" nor a "focus ring" if I'm not mistaken - so, what is it, actually? I'm currently drawing custom NSCells completely myself - but I can't figure out how to either * draw this outline by myself, too, or * get rid of it, or * at least change its colour Any hints are very welcome! Thanks! Nicholas Riley Unfortunately I'm not aware of any documented way

NSTableView with dynamic height

落花浮王杯 提交于 2019-12-04 04:52:14
问题 I am working on Xcode 6.1.1 on OSX 10.10.2 How do I make my table adjust its height, so that the height of table would always be equal to the sum of heights of all the rows. In other words, it should not display any empty rows. And adding and deleting the rows would require NSTableView to resize it self. Initially I was thinking of using following selection after addition and deletion of row. [_tableViewHandle setFrameSize:(NSMakeSize(oldwidth, sumOfHeightOfAllRows)))] But it looks like a