searching for strings containing "

2011-09-26 Thread Koen van der Drift
How do I use isEqualToString with strings that contain a " ? The string I try to find is for instance: name= "foo" Type="bar" So: if ([myString isEqualToString: @"name= "foo" Type="bar"") Gives an error because there are too many " symbols. I looked into replacing the " with ' by usi

Re: searching for strings containing "

2011-09-26 Thread Koen van der Drift
SIGNED MESSAGE- > Hash: SHA1 > > On 9/26/11 5:26 PM, Koen van der Drift wrote: >> How do I use isEqualToString with strings that contain a " ? >> >> The string I try to find is for instance: name= "foo" Type="bar" >> >> So: &

Re: searching for strings containing "

2011-09-26 Thread Koen van der Drift
Ah, found it, that info is in the attributeDict. - Koen. On Sep 26, 2011, at 11:42 PM, Koen van der Drift wrote: > Thanks. The string I'm trying to match in an xml file that I'm parsing using > NSXMLElement. > > Here's part of the xml fie: > >

delegate of an NWindowController's window

2011-09-29 Thread Koen van der Drift
I'm trying to get the delegate of a window that is controlled by a custom NSWindowController as follows: NSWindow *win = [self window]; id del = [win delegate]; But get the following warning: warning: Semantic Issue: Initializing 'id' with an expression of incompatible type 'id

Re: delegate of an NWindowController's window

2011-09-29 Thread Koen van der Drift
Thanks for the response, but, still not working. Here's in more detail what I'm trying to do. My main window is controlled by MyAppDelegate: @interface MyAppDelegate : NSObject In MyAppDelegate I respond to an IBAction to open a second window to generate some data that needs to be go back

Re: delegate of an NWindowController's window

2011-09-29 Thread Koen van der Drift
On Sep 29, 2011, at 9:03 PM, Conrad Shultz wrote: > > An alternate approach, depending on the details of your > implementation, might be to make use of some of the other parameters > in that lengthy -beginSheet... method; setting appropriate values for > didEndSelector (and, potentially, contextI

combining two entities to one binding

2011-10-01 Thread Koen van der Drift
In my core data model, I have several string properties that I would like to bind to one NSTextView. So, I would like the text view to show both the name and description entities as if they were one string. Is there a way to do this, in IB I can only bind one at the time (I think). Thanks, - K

Re: combining two entities to one binding

2011-10-02 Thread Koen van der Drift
On Oct 1, 2011, at 3:09 PM, Keary Suska wrote: > Not specifically for NSTextView. Text fields have the "value with pattern" > bindings, but no such luck for text views. In such cases I generally have a > "dynamic" property of a model object that consists of a pseudo-getter and > +keyPathsForVa

Re: combining two entities to one binding

2011-10-02 Thread Koen van der Drift
On Oct 2, 2011, at 10:11 AM, Keary Suska wrote: > Unfortunately not in the binding text itself, at least AFAIK. There are a > number of ways to do this, the most obvious being adding a method to your > model class such as: > > - (NSString *)hardReturn > { > return @"\n"; > } > > and add

NSTreeController with bindings and core data - still an issue?

2011-10-10 Thread Koen van der Drift
Hi, I'm looking to implement a simple iTunes/Mail like source list in an app, and have been rummaging through the internets for some decent tutorials and sample code. I found some, but they are all a bit outdated. Basically, I want to combine my Core Data model with an NSOutlineView and NSTreeCont

Re: NSTreeController with bindings and core data - still an issue?

2011-10-10 Thread Koen van der Drift
On Mon, Oct 10, 2011 at 12:40 PM, Richard Somers wrote: > When Wil Shipley wrote his blog article in April 2006 the API was at the 10.4 > Tiger level. Since then NSTreeController has had one method revised and six > > new methods have been added in the 10.5 Leopard API. The 10.5 release notes

CoreRecipes in Xcode4 ?

2011-10-11 Thread Koen van der Drift
Hi, How can I open the CoreRecipes sample project in Xcode 4? The project seems to be of an older version. With Xcode3 I get the option to update the project, but then the save as dialog screen freezes. Thanks, - Koen.___ Cocoa-dev mailing list (C

'Static' items in an NSOutlineView

2011-10-14 Thread Koen van der Drift
Hi, I’m trying to find out how to create the grayish, static items in an NSOutlineView, eg “Library” in iTunes or “Mailboxes” in Mail. Sometimes they have a disclosure triangle, eg "Devices" in the Finder. I think I need to subclass NSCell to change the font, etc. But I am not sure how to identify

Re: 'Static' items in an NSOutlineView

2011-10-15 Thread Koen van der Drift
Thanks for the pointers. I also just found this sample code from Apple: ,http://developer.apple.com/library/mac/#samplecode/SidebarDemo/> They don't use CoreData but I may be able to adapt it. - Koen. On Oct 14, 2011, at 2:51 PM, Quincey Morris wrote: > On Oct 14, 2011, at 09:24

Re: 'Static' items in an NSOutlineView

2011-10-15 Thread Koen van der Drift
wrote: > On Oct 14, 2011, at 09:24 , Koen van der Drift wrote: > >> I’m trying to find out how to create the grayish, static items in an >> NSOutlineView, eg “Library” in iTunes or “Mailboxes” in Mail. >> Sometimes they have a disclosure triangle, eg "Devices" in the

"Using Drag and Drop in Tables" link gone?

2011-10-17 Thread Koen van der Drift
An Apple document call "Using Drag and Drop in Tables" is mentioned here: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DragandDrop/DragandDrop.html, But there is no link provided. Searching for that title also has no results. Does anyone know if this document maybe has

Re: 'Static' items in an NSOutlineView

2011-10-17 Thread Koen van der Drift
As I posted a few days ago, I was able to create the 'static items' in my outlineview, What I am now trying to do is to set the order of the static items, without changing the order of the other groups in the view. Using a sortdescriptor won't work, since it will order *all* groups, including t

Re: "Using Drag and Drop in Tables" link gone?

2011-10-17 Thread Koen van der Drift
On Oct 17, 2011, at 11:29 AM, lowell wrote: > If you have the docs installed locally, the document is at > > /Library/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleLion.CoreReference.docset/Contents/Resources/Documents/index.html#documentation/Cocoa/Conceptual/DragandDrop/Usin

Re: 'Static' items in an NSOutlineView

2011-10-18 Thread Koen van der Drift
On Tue, Oct 18, 2011 at 12:19 AM, Quincey Morris wrote: > On Oct 17, 2011, at 19:58 , Koen van der Drift wrote: > > What it should look like is: > > LIBRARY (static) > Group1 > Group2 > > > FAVORITES (static) > Group3 > Group4 > > RECENT (static) >

Re: 'Static' items in an NSOutlineView

2011-10-18 Thread Koen van der Drift
On Tue, Oct 18, 2011 at 3:21 PM, Quincey Morris wrote: > On Oct 18, 2011, at 05:20 , Koen van der Drift wrote: > > We're talking about Core Data, right? Objects in a Core Data persistent > store have no intrinsic order, though they can be indexed on one of their > propert

NSOutlineView drag and drop: how to prevent parent being dropped on one of its children

2011-10-29 Thread Koen van der Drift
Hi, I'm setting up drag and drop for my NSOutlineView and I want to prevent parents being dropped on one of their children. The parent and children are all of the Group entity. I understand I need to do this in the outlineView:validatedrop method. I think I need to create an NSFetchRequest with

Re: NSOutlineView drag and drop: how to prevent parent being dropped on one of its children

2011-10-29 Thread Koen van der Drift
Thanks Kyle, I'll try to apply that. In the meantime, I also found the AbstractView sample code which does something similar. I'll see which one fits my code better. - Koen. On Oct 29, 2011, at 5:34 PM, Kyle Sluder wrote: > On Sat, Oct 29, 2011 at 1:18 PM, Koen van der D

How to bind to a custom controller class?

2011-11-06 Thread Koen van der Drift
How do I bind a controller class to my core data model? The controller class (a subclass of NSObject) needs to access the value that is at arrangedObjects.name in an NSArrayController. The NSArrayController feeds an NSTableView, and that works fine through bindings, but I don't know how to tap into

Re: How to bind to a custom controller class?

2011-11-06 Thread Koen van der Drift
to all views. Then I bound my view in IB to the File's Owner (the AppDelegate) representedObject.arrayController.name, et voila, it works! - Koen. On Sun, Nov 6, 2011 at 5:14 AM, Koen van der Drift wrote: > How do I bind a controller class to my core data model? The controller > class

Cannot D&D from an NSTableView

2011-11-13 Thread Koen van der Drift
Hi, I am setting up D&D from an NSTableView, but I cannot drag any items. I have added registerForDraggedTypes and - (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard to my table view controller, and the controller is bo

Re: Cannot D&D from an NSTableView

2011-11-14 Thread Koen van der Drift
ov 13, 2011 at 11:45 PM, Jens Alfke wrote: > > On Nov 13, 2011, at 6:12 PM, Koen van der Drift wrote: > > I am setting up D&D from an NSTableView, but I cannot drag any items. I have > added registerForDraggedTypes and - (BOOL)tableView:(NSTableView > *)aTableView write

Variable window size based on screen resolution

2011-11-14 Thread Koen van der Drift
Is there a way to a window open in a size relative to the resolution of the screen? For instance, I am writing an app on a MacBook with a 13" screen. On my screen, the main window is almost the size of the complete screen. What happens if someone on a 21" iMac opens the application? Will the main w

Implementing Full Screen for 10.7 but app should also run on 10.6

2011-11-14 Thread Koen van der Drift
Another window size question, just putting it ina another thread. I'd like my application to use the full screen feature on 10.7, but the app should also run on 10.6 I tried adding NSWindowCollectionBehaviorFullScreenPrimary for my main window, but got an error since I am building agains 10.6 SDK

Re: Implementing Full Screen for 10.7 but app should also run on 10.6

2011-11-14 Thread Koen van der Drift
On Mon, Nov 14, 2011 at 1:20 PM, Quincey Morris wrote: > On Nov 14, 2011, at 07:15 , Koen van der Drift wrote: > > I'd like my application to use the full screen feature on 10.7, but > the app should also run on 10.6  I tried adding > NSWindowCollectionBehaviorFullScreenPrimar

Re: Cannot D&D from an NSTableView

2011-11-14 Thread Koen van der Drift
On Nov 14, 2011, at 4:49 PM, Graham Cox wrote: > > On 15/11/2011, at 12:05 AM, Koen van der Drift wrote: > >> I am using a custom cell > > > This is most likely the cause. Try substituting a standard text cell and see > if the drag works. If so, you know where to

Re: Implementing Full Screen for 10.7 but app should also run on 10.6

2011-11-14 Thread Koen van der Drift
On Nov 14, 2011, at 4:55 PM, Graham Cox wrote: > If you are using Xcode 4.x, you can just flag the "supports fullscreen" in IB > and it just works. You get a warning that the feature isn't supported on 10.6 > or earlier when the nib is compiled, but it's OK - earlier systems just > ignore that

Re: Cannot D&D from an NSTableView

2011-11-14 Thread Koen van der Drift
On Nov 14, 2011, at 7:15 PM, Conrad Shultz wrote: > Are you subclassing NSCell directly or using one of its subclasses? > > Out of the box, NSTableView (or, rather, NSTableColumn) uses an > NSTextFieldCell, which importantly inherits from NSActionCell, which > itself adds lots of core functional

Re: Cannot D&D from an NSTableView

2011-11-14 Thread Koen van der Drift
u return > just NSCellHitContentArea? > > (I'm assuming from your original message that you had been using the default > hit test implementation.) > > (Sent from my iPhone.) > > -- > Conrad Shultz > > On Nov 14, 2011, at 17:05, Koen van der Drift > wro

"byte orders" question

2011-11-25 Thread Koen van der Drift
I'm trying to implement the following code into my Cocoa project: for (n = 0 ; n < (2 * count) ; n++) { ((u_int32_t *) result)[n] = ntohl((u_int32_t) ((u_int32_t *) decoded)[n]); } with the following requirements: // byte order correction decoded has network byte order data // result h

Re: "byte orders" question

2011-11-25 Thread Koen van der Drift
On Nov 25, 2011, at 4:30 PM, Ben Kennedy wrote: > On 25 Nov 2011, at 12:58 pm, Koen van der Drift wrote: > >> How do I obtain the "network byte order data" and "byte order of the host >> machine" so I get the correct results? > > Check out NSHost

Re: "byte orders" question

2011-11-25 Thread Koen van der Drift
. - Koen. On Nov 25, 2011, at 5:20 PM, Koen van der Drift wrote: > > On Nov 25, 2011, at 4:30 PM, Ben Kennedy wrote: > >> On 25 Nov 2011, at 12:58 pm, Koen van der Drift wrote: >> >>> How do I obtain the "network byte order data" and "byte order

Re: "byte orders" question

2011-11-25 Thread Koen van der Drift
On Nov 25, 2011, at 5:44 PM, Scott Ribe wrote: > As another response suggested, what's wrong with ntohl??? I implemented that function based on some code I found online, but got very weird results, which is why I asked here. My knowledge on these esoteric functions apparently isn't up to par

Re: "byte orders" question

2011-11-25 Thread Koen van der Drift
On Nov 25, 2011, at 7:07 PM, Glenn L. Austin wrote: > On Nov 25, 2011, at 2:56 PM, Koen van der Drift wrote: > >> On Nov 25, 2011, at 5:44 PM, Scott Ribe wrote: >> >>> As another response suggested, what's wrong with ntohl??? >> >> I implemented tha

Re: "byte orders" question

2011-11-26 Thread Koen van der Drift
First of all, thanks all for the input. After thinking about it a lot this morning, I probably should have approached this with a different question :) "Starting with a base64 encoded string, how do I obtain a series of float values out of it?" The string is obtained from an XML file (using NS

Re: "byte orders" question

2011-11-26 Thread Koen van der Drift
On Nov 26, 2011, at 4:23 PM, Scott Ribe wrote: > No, you're not ;-) You read a string that is presumably already Base64 > encoded, then you stuff it into an NSData, then you Base64 encode that, then > you decode it, leaving you with the original Base64 encoding intact... > > Instead of: > >>

Re: "byte orders" question

2011-11-26 Thread Koen van der Drift
On Nov 26, 2011, at 6:17 PM, Koen van der Drift wrote: > Now I need to figure out how to go from u_int_32 to float. I think I figured it out: for (NSInteger n = 0; n < 4; n++) { u_int32_t value; [base64DecodedData getBytes:&value range:NSM

Re: "byte orders" question

2011-11-26 Thread Koen van der Drift
On Nov 26, 2011, at 6:37 PM, Charles Srstka wrote: > If the source code that is sending you the data in the first place is your > own code, you could have that code use the CFConvertFloat32ToSwapped() before > sending it, and then your client can use CFConvertFloat32SwappedToHost() to > conver

Re: "byte orders" question

2011-11-27 Thread Koen van der Drift
On Nov 26, 2011, at 7:06 PM, Scott Ribe wrote: > I think what you had before would work for the byte swap & conversion, > assuming that your "result" was an array of floats; CFSwapInt32HostToBig is > not really the right call--when it works it is by accident. Thanks again Scott for thinking al

Re: "byte orders" question

2011-11-27 Thread Koen van der Drift
On Nov 27, 2011, at 10:02 AM, Scott Ribe wrote: > The purpose of casting? I think you need to review a C reference, you're > casting a uint32_t to uint32_t * then back to uint32_t. In prior code you > were casting something (unsigned char * ???) to uint32_t *, then > dereferencing it, which wo

Re: "byte orders" question

2011-11-28 Thread Koen van der Drift
> He said that the sender isn’t his own code and isn’t something he can change, > and that it is apparently sending raw binary data (in > Base64 encoding). If you’re sending raw binary data, you’d *better* define > the widths of your fields as part of the specification. > >Charles Just for clari

About Face - 3rd edition

2011-12-09 Thread Koen van der Drift
For those of you interested in UI design (and aren't we all?), I just saw that a 3rd edition is about to be published of "About Face - The Essentials of Interaction Design": http://www.amazon.com/About-Face-Essentials-Interaction-Design/dp/0470084111/ref=sr_1_1?ie=UTF8&s=books&qid=1279145077&sr=1-

responding to NSStepper clicks

2011-12-15 Thread Koen van der Drift
I've set up an NSStepper/NSTextField combination to control myInt in my model. I have bound the value of myInt to both outlets, and when I click the stepper, the value of myInt in the textfield changes accordingly. All good. I've set up the delegate controlTextDidChange, and my model changes when I

Re: responding to NSStepper clicks

2011-12-15 Thread Koen van der Drift
On Thu, Dec 15, 2011 at 10:17 AM, Mike Abdullah wrote: > NSStepper is a subclass of NSControl. Hook up its action/target to be > notified when it's adjusted. I'll try that, thanks. Using bindings sometimes makes you forget that there is still some cdong needed :) - Koen. _

Re: responding to NSStepper clicks

2011-12-16 Thread Koen van der Drift
On Thu, Dec 15, 2011 at 10:50 AM, Koen van der Drift wrote: > On Thu, Dec 15, 2011 at 10:17 AM, Mike Abdullah > wrote: > >> NSStepper is a subclass of NSControl. Hook up its action/target to be >> notified when it's adjusted. > > I'll try that, thanks.  Usin

Re: responding to NSStepper clicks

2011-12-16 Thread Koen van der Drift
Thanks, I'll look at it again and make sure everything is hooked up correctly. - Koen. On Fri, Dec 16, 2011 at 8:15 AM, Peter wrote: > > Am 16.12.2011 um 13:59 schrieb Koen van der Drift: > >> On Thu, Dec 15, 2011 at 10:50 AM, Koen van der Drift >> wrote: >>

Re: responding to NSStepper clicks

2011-12-16 Thread Koen van der Drift
16 Dec 2011, at 12:59, Koen van der Drift wrote: > >> On Thu, Dec 15, 2011 at 10:50 AM, Koen van der Drift >> wrote: >>> On Thu, Dec 15, 2011 at 10:17 AM, Mike Abdullah >>> wrote: >>> >>>> NSStepper is a subclass of NSControl. Hook up its act

Re: responding to NSStepper clicks

2011-12-16 Thread Koen van der Drift
On Dec 16, 2011, at 10:40 AM, Mike Abdullah wrote: > Your text field is is bound to the model/a controller right? If so, you want > the "updates immediately" binding option. > > On 16 Dec 2011, at 12:59, Koen van der Drift wrote: > >> On Thu, Dec 15, 2011

Re: responding to NSStepper clicks

2011-12-17 Thread Koen van der Drift
On Dec 16, 2011, at 11:48 PM, Quincey Morris wrote: > There are various solutions you might choose, depending on how you expect to > handle validation errors for your text field. You can add a number formatter > to the field, or you can change the property to type long long (though you > then

Re: responding to NSStepper clicks

2011-12-18 Thread Koen van der Drift
On Dec 18, 2011, at 7:41 AM, Mike Abdullah wrote: > You *have* to use a number formatter. What you've probably got a present is > the text field sending NSString objects down into the model. You're not > seeing an immediate problem because NSNumber is an object just like NSString, > and so can

brushing up my skills/knowledge

2011-05-24 Thread Koen van der Drift
First post since a long time... I did some Cocoa/ObjC coding several years ago, but haven't really touched it since. I want to dive back in, and am looking for resources to brush up my knowledge, especially related to subjects like CoreData, CoreAnimation, etc. Besides the obvious docs at Apple,

drawing lines in and NSTextView

2012-03-31 Thread Koen van der Drift
I have an NSTextView to which I want to add some lines that connect certain words. When the text changes, either by editing, or scrolling, that lines should follow the words. I thought about using CoreAnimation, but text in a CATextLayer does not appear to be editable like the text in an NSTextView

Re: drawing lines in and NSTextView

2012-04-01 Thread Koen van der Drift
ox wrote: > >> >> On 31/03/2012, at 11:08 PM, Koen van der Drift wrote: >> >>> I have an NSTextView to which I want to add some lines that connect >>> certain words. When the text changes, either by editing, or scrolling, >>> that lines should follow the wo

Bounds of selected NSTableView cell

2012-04-08 Thread Koen van der Drift
I am trying to find out what the bounds are of the cell of an NSTableView that was clicked in. I'd like to use that rect to show a NSPopover when the user double clicks on a cell. I have this in my NSTableView controller class: -(IBAction)doubleClickAction:(id)sender { NSInteger row = [

Re: Bounds of selected NSTableView cell

2012-04-08 Thread Koen van der Drift
On Apr 8, 2012, at 12:08 PM, Felix Franz wrote: > you can use NSTableView>>frameOfCellAtColumn:row: to get the frame of the > cell at the columnIndex/rowIndex. Thanks! - Koen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not p

clearing a webview after use

2012-04-11 Thread Koen van der Drift
In my application (OSX) I implemented an NSPopover that displays a webview to show more info on a a particular item in my model (which are listed in an NSTableView). So the user doubleclicks the table, and the popover appears and shows the website related to that item. I implemented back and forwar

Re: clearing a webview after use

2012-04-11 Thread Koen van der Drift
On Apr 11, 2012, at 10:36 AM, Fritz Anderson wrote: > On 11 Apr 2012, at 7:51 AM, Koen van der Drift wrote: > >> Is there a way to empty or clear a webview when I close the popover, >> so that next time it is opened it doesn't show the previous page? I >> don'

Webview cache location

2012-04-13 Thread Koen van der Drift
I am using a webview in my app, and am wondering where the cache is stored? Is there a specific location for each app, or is it shared with the Safari cache? Thanks, - Koen. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post adm

Re: Webview cache location

2012-04-13 Thread Koen van der Drift
12, at 10:15 AM, Koen van der Drift wrote: > >> I am using a webview in my app, and am wondering where the cache is >> stored? Is there a specific location for each app, or is it shared >> with the Safari cache? >> >> Thanks, >> >> - Koen. >> _

Re: Webview cache location

2012-04-13 Thread Koen van der Drift
Unfortunately that link doesn't seem applicable to my situation. I'm just trying to find the location on my HD, so I can empty it for debugging purposes. - Koen. On Fri, Apr 13, 2012 at 10:37 AM, Koen van der Drift wrote: > Thanks for the link. My app is OSX, so will see if it

activating Delete menu item through binding

2012-04-15 Thread Koen van der Drift
My MainMenu.nib has a 'Delete' menu item that is mapped to the Delete key. I'd like to use that to remove items from my NSTableView that is connected to an NSArrayController. So in the bindings for the Delete menu item, I set it's availability to myArrayController.canRemove. However, the Dele

Re: activating Delete menu item through binding

2012-04-15 Thread Koen van der Drift
dation, etc. - Koen. On Apr 15, 2012, at 2:43 PM, Quincey Morris wrote: > On Apr 15, 2012, at 11:13 , Koen van der Drift wrote: > >> My MainMenu.nib has a 'Delete' menu item that is mapped to the Delete key. >> I'd like to use that to remove items from my NSTa

Re: activating Delete menu item through binding

2012-04-16 Thread Koen van der Drift
g the view controller first responder didn't work either. Any suggestions what I should do ? Thanks again, - Koen. On Sun, Apr 15, 2012 at 3:06 PM, Quincey Morris wrote: > On Apr 15, 2012, at 11:53 , Koen van der Drift wrote: > > Interestingly, the 'Select All' menu

Re: activating Delete menu item through binding

2012-04-24 Thread Koen van der Drift
On Apr 16, 2012, at 7:34 PM, Quincey Morris wrote: > Yes, that's an awkward case. Although a NSViewController *is* a responder, it > *isn't* automatically added to the responder chain. Therefore it cannot be > found as first responder, and so its action method is not recognized by menu > valid

Re: activating Delete menu item through binding

2012-04-24 Thread Koen van der Drift
On Apr 21, 2012, at 11:01 PM, Quincey Morris wrote: > It's not clear what went wrong with '[employeeController remove: nil]', but > that's a completely separate problem. For example, if you left the array > controller in Class mode rather than Entity mode, 'remove:' won't update Core > Data pr

NSTableView doesn't show data until I click on a header

2012-04-28 Thread Koen van der Drift
I have an NSTableView bound to an NSArrayController displaying some data in my app that are calculated when the user clicks a button. Initially no data is shown, but it appears once I click on one of the column headers. All the columns are filled with the correct data as I specified in the bindi

Re: NSTableView doesn't show data until I click on a header

2012-04-29 Thread Koen van der Drift
On Apr 28, 2012, at 6:21 PM, Keary Suska wrote: > Are you updating the model data in a KVO-compliant way? Bingo! Thanks for pointing that out, I kept looking at my connections in IB, and forgot about the actual code. So for future reference, my data model is an NSMutableArray. Instead of add

Re: NSTableView doesn't show data until I click on a header

2012-04-29 Thread Koen van der Drift
. On Apr 29, 2012, at 12:22 PM, Koen van der Drift wrote: > > On Apr 28, 2012, at 6:21 PM, Keary Suska wrote: > >> Are you updating the model data in a KVO-compliant way? > > Bingo! Thanks for pointing that out, I kept looking at my connections in IB, > and forgot about

Re: NSTableView doesn't show data until I click on a header

2012-04-30 Thread Koen van der Drift
On Apr 29, 2012, at 8:45 PM, Keary Suska wrote: > Yes, it does, but only if the cell prototype has an NSNumberFormatter > attached to it. How did you apply the formatter? By dragging it in IB onto the cell of the column. - Koen. ___ Cocoa-dev mailin

Re: NSTableView doesn't show data until I click on a header

2012-04-30 Thread Koen van der Drift
h (I think) is what I am doing now. But it's too early and I haven't drank all my coffee yet :) - Koen. On Sun, Apr 29, 2012 at 10:56 PM, mmalc Crawford wrote: > > On Apr 29, 2012, at 9:22 AM, Koen van der Drift > wrote: > > So for future reference, my data mode

Re: NSTableView doesn't show data until I click on a header

2012-04-30 Thread Koen van der Drift
On Mon, Apr 30, 2012 at 12:03 PM, Quincey Morris wrote: > What's at stake here is KVO compliance. If you have a class MyClass with an > indexed (array) property "things", you can implement the indexed mutable > accessors -- basically 'insertObject:inThingsAtIndex:' and > 'removeObjectFromThingsAt

Re: NSTableView doesn't show data until I click on a header

2012-05-02 Thread Koen van der Drift
indexSetWithIndexesInRange: range]; [self removeMyObjectsAtIndexes: indexes]; - (void) removeMyObjectsAtIndexes: (NSIndexSet *)indexes { [self.myArray removeObjectsAtIndexes: indexes]; } Thanks, - Koen. On Mon, Apr 30, 2012 at 12:40 PM, Quincey Morris wrote: > On Apr 30, 2012, at 09:27 , Koen

Re: NSTableView doesn't show data until I click on a header

2012-05-03 Thread Koen van der Drift
On Wed, May 2, 2012 at 10:15 PM, Koen van der Drift wrote: > Got it, it all works (I think :). > > The only thing that made me scratch my head was how to empty the whole > array. I am of course aware of [myArray removeAllObjects], but is that KVO compliant? I couldn't find

Re: NSTableView doesn't show data until I click on a header

2012-05-03 Thread Koen van der Drift
On May 3, 2012, at 6:45 AM, Roland King wrote: > It's not, no. If you want a KVO way of removing all the objects use the > removeAtIndexes: or just set: with an empty array. You'll get > different types of KVO message (NSKeyValueChangeRemoval vs > NSKeyValueChangeSetting). Thanks! I was indee

monitoring changes in a local property

2012-05-07 Thread Koen van der Drift
One of my viewcontrollers uses the representedObject to bind to the NSArrayController that holds all the data for the application (OS X, ARC on). I declared a local property mySelection (an NSArray) and bind it to the representedObject as follows: [self bind:@"mySelection" toObject:self.rep

Re: monitoring changes in a local property

2012-05-07 Thread Koen van der Drift
On May 7, 2012, at 11:28 PM, Roland King wrote: > -(void)setMySelection:(NSArray*)newSelection > { > // set whatever instance variable you have for mySelection, > with appropriate memory management if necessary I thought about that too, but how do I do that when using ARC? Can I

Re: monitoring changes in a local property

2012-05-08 Thread Koen van der Drift
On Tue, May 8, 2012 at 12:27 AM, Quincey Morris wrote: > It's not obvious why you need a "mySelection" property at all. It's used in a master-detail setup in my application. Briefly, my application has the familiar Mail layout: A column (outlineview) on the left with groups, then a column (tabl

Re: monitoring changes in a local property

2012-05-09 Thread Koen van der Drift
On May 8, 2012, at 12:27 AM, Quincey Morris wrote: > P.S. Personally, I wouldn't bind to a NSArrayController like this, because it > just obscures the MVC lines of your app. The array controller is getting its > content from somewhere: from this view controller itself, from a window > controll

Re: monitoring changes in a local property

2012-05-09 Thread Koen van der Drift
On May 9, 2012, at 10:12 PM, Quincey Morris wrote: > The array controller is also bound to some indexed property of your app > delegate, "myThings". For example, you might have (in the app delegate .h > file): In my case, the contentset of the array controller is bound to a tree controller (w

Re: monitoring changes in a local property

2012-05-10 Thread Koen van der Drift
ay 10, 2012, at 12:39 AM, Quincey Morris wrote: > On May 9, 2012, at 19:56 , Koen van der Drift wrote: > >> In my case, the contentset of the array controller is bound to a tree >> controller (which is bound to the MOC of my model). I fail to see how I >> also bind it

AwakeFromNib called twice for sheet

2012-05-12 Thread Koen van der Drift
Hi, My app (OSX) has a sheet to obtain data from a server and display them in an NSTableView. So far I was using a Cell based table and it worked fine. Yesterday I decided to make the table view based, following the instruction by Apple

Re: AwakeFromNib called twice for sheet

2012-05-12 Thread Koen van der Drift
I solved it by using windowDidLoad instead of awakeFromNib. - Koen. On May 12, 2012, at 8:01 AM, Koen van der Drift wrote: > Hi, > > My app (OSX) has a sheet to obtain data from a server and display them in an > NSTableView. So far I was using a Cell based table and it

Re: AwakeFromNib called twice for sheet

2012-05-12 Thread Koen van der Drift
On May 12, 2012, at 3:53 PM, Kyle Sluder wrote: > t would be good for you to understand why this is happening. > > When building a view-based table in IB, the NSTableCellView instances you see > are actually contained within embedded nibs. This makes sense, because nibs > are the standard mech

Nested XML -> CoreData

2012-05-15 Thread Koen van der Drift
I'm parsing a large XML file using NSXMLParser (OS X) and part of the nested structure is similar to this: ... ... Home 123-555-1234 Work 345-555-6612 Mobile 222-555-8901 ... ... In advance I don't know how many phonenumbers there will be, there could be none, or more

Re: Nested XML -> CoreData

2012-05-16 Thread Koen van der Drift
Thanks for the feedback, very helpful. I will definitely swich to an sqlstore, right now I am using xml for debugging purposes. I will also create entities for each node. - Koen. On Tue, May 15, 2012 at 7:49 PM, Chris Hanson wrote: > On May 15, 2012, at 7:29 AM, Koen van der Drift >

dragging from view based table view

2012-05-29 Thread Koen van der Drift
This weekend I switched from a cell-based table view to a view-based table view (OS X) . It is a one column table, and I use two static text items in each cell to display some info, bound to my NSArrayController. So far so good, I subclassed NSTableCellView and can modify the appearance of the te

can't hide scrollbar on NSTableView

2012-06-04 Thread Koen van der Drift
Ok, I'm stumped here. I have a few scrollable views in my window, two NSTableViews, and an NSTextView. I'd like to have the scrollbar to hide when not in use, and used the setting of the NSScrollView in IB in Xcode to do so. For the NSTextView it works, but for the NSTableViews the scrollbar won'

Re: can't hide scrollbar on NSTableView

2012-06-05 Thread Koen van der Drift
On Jun 5, 2012, at 7:16 PM, Corbin Dunn wrote: > > On Jun 4, 2012, at 11:48 AM, Koen van der Drift > wrote: > >> Ok, I'm stumped here. I have a few scrollable views in my window, two >> NSTableViews, and an NSTextView. I'd like to have the scrollbar to >

Re: can't hide scrollbar on NSTableView

2012-06-06 Thread Koen van der Drift
On Wed, Jun 6, 2012 at 12:42 PM, Corbin Dunn wrote: > It has a scroller there because it has scrollable area. Yes, but it should hide when I am not scrolling (as was the case when taking the screenshot). > All I can guess is that something has some scrollable area or the property is > reset so

Re: can't hide scrollbar on NSTableView

2012-06-06 Thread Koen van der Drift
On Jun 6, 2012, at 4:51 PM, Corbin Dunn wrote: > Just call setScrollerStyle to NSScrollerStyleOverlay to force it on. > NSScrollView decides if it can be on or off by default using a special > algorithm; you might be tripping it up by having a view that intersects with > the scroll area, so yo

Re: can't hide scrollbar on NSTableView

2012-06-06 Thread Koen van der Drift
On Jun 6, 2012, at 4:51 PM, Corbin Dunn wrote: > you might be tripping it up by having a view that intersects with the scroll > area This turned out to be a good suggestion; I made the scrollview a few pixels less wide, and I now get the expected scroll bar behavior, even without calling setS

iCloud/Core Data docs for Mac ?

2012-07-03 Thread Koen van der Drift
Are there any Apple OSX docs on how to use iCloud and Core Data? All I could find was some release notes for iOS: http://developer.apple.com/library/ios/#releasenotes/DataManagement/RN-iCloudCoreData/_index.html. Thanks, - Koen. ___ Cocoa-dev mailing l

Binding NSTableView to NSSet

2012-07-04 Thread Koen van der Drift
Hi, I am trying to hookup a view based NSTableView to my CoreData model using bindings. The table should display various attributes of the entity 'Tags', which has a many-to-one relationship with my main entity. In my code I can see that the Tags entities are valid using NSLog statements, howe

Re: Binding NSTableView to NSSet

2012-07-04 Thread Koen van der Drift
Ok, I found the solution. I added an NSArrayController to the nib, of which I bound the content set to the NSSet of my model. Then I bound the NSTableView to the NSArrayController, and the views to the various attributes through the objectVAlue. - Koen. On Jul 4, 2012, at 1:46 PM, Koen van

changing string in a view based NSTableView

2012-07-07 Thread Koen van der Drift
I'd like to change the change the string that is displayed in my view based NSTableView to a lowercase string. So I implemented the following in the delegate of the tableview: - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {

Re: Binding NSTableView to NSSet

2012-07-13 Thread Koen van der Drift
#//apple_ref/doc/uid/1026i-CH10-SW1. Would that be a good approach? Other alternatives? OSX, 10.7. Thanks, - Koen. On Jul 4, 2012, at 5:59 PM, Koen van der Drift wrote: > Ok, I found the solution. > > I added an NSArrayController to the nib, of which I bound the content set

  1   2   3   4   >