Core data and disabling undo registration

2011-07-17 Thread Gideon King
Hi all, in the documentation Using Managed Objects, it says that we should use: [moc processPendingChanges]; // flush operations for which you want undos [[moc undoManager] disableUndoRegistration]; // make changes for which undo operations are not to be recorded [moc processPendingChanges];

Really strange NSTableView issue

2011-07-15 Thread Gideon King
I have a table view which uses an array controller for the contents, and as a data source and delegate so I can do drag and drop etc. It displays my data (Colors) just fine, but in one particular scenario something somewhere is over-releasing an NSIndexSet. I have stripped it right back to the

Re: Really strange NSTableView issue

2011-07-15 Thread Gideon King
OK, as usual, 10 minutes after sending the email to the list, something new turns up. The *only* time that this problem occurs is when the drag source is the table view in the Color Palettes section of the Color panel. Still no idea what's causing it, but at least the problem is narrowed down.

Re: Really strange NSTableView issue

2011-07-15 Thread Gideon King
PM, Quincey Morris wrote: On Jul 15, 2011, at 01:40, Gideon King wrote: - (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rowIndices toPasteboard:(NSPasteboard *)pboard { return YES; } This looks suspicious, because it's asking you to write specific

Problem with bound text field in accessory panel

2011-05-11 Thread Gideon King
Hi, I have a text field which is used in a save panel accessory when exporting files from my program. It is bound to the user defaults, and has continuous updating of values turned on so that if the user presses Return to complete the save operation, I still have the current value even though

Re: Problem with bound text field in accessory panel

2011-05-11 Thread Gideon King
, 2011 at 6:26 PM, Gideon King gid...@novamind.com wrote: Hi, I have a text field which is used in a save panel accessory when exporting files from my program. It is bound to the user defaults, and has continuous updating of values turned on so that if the user presses Return to complete the save

Pasting a PDF image in text: NSCGImageSnapshotRep and upside down drawing

2011-03-27 Thread Gideon King
Hi, I am trying to work out an issue with some text editing and drawing. I paste a PDF image file into some text that is being edited using a text view, and as expected, the text storage gets a text attachment with an image with a PDF image rep passed to it. Then by the time it gets to

Re: Problem with NSPredicate in core data fetch request

2011-03-14 Thread Gideon King
Grosam wrote: On Mar 13, 2011, at 3:08 PM, Gideon King wrote: I'm seeing a strange thing with a predicate. When I apply the predicate to a fetch request, it doesn't return any results, but when I do the fetch without the predicate and then use filteredArrayUsingPredicate to filter

Problem with NSPredicate in core data fetch request

2011-03-13 Thread Gideon King
I'm seeing a strange thing with a predicate. When I apply the predicate to a fetch request, it doesn't return any results, but when I do the fetch without the predicate and then use filteredArrayUsingPredicate to filter the results, it has the matching row that I expect. Here are the results

Re: NSXMLElement children doesn't return whitespace text nodes

2011-03-03 Thread Gideon King
I recall that I had problems with that too, and IIRC, the NSXMLNodePreserveWhitespace didn't seem to work, but right now I have xml:space=preserve in the XML and parse it with just the NSXMLDocumentTidyXML option, and that works. I believe I just went through all the combinations and

Re: black flashes when updating CALayer content

2011-02-24 Thread Gideon King
I have seen this too. Exactly the same scenario. I have it on my urgent to-do list to look at, but have not got to it yet. It was first reported to me by a user and we could never reproduce it here, but another user has sent us a file which exhibits the problem on all the machines I have tried.

Best text rendering settings?

2011-02-04 Thread Gideon King
Hi, I have a layer I want to draw some text on (10.6 target). To actually draw the text, I am creating the NSGraphicsContext using the graphics port, and using drawBackgroundForGlyphRange... and drawGlyphsForGlyphRange... to draw the text. The output never looks as good as plain old text in a

Re: Best text rendering settings?

2011-02-04 Thread Gideon King
. On 05/02/2011, at 2:40 AM, David Duncan wrote: On Feb 4, 2011, at 5:15 AM, Gideon King wrote: The output never looks as good as plain old text in a text view. Do you draw a background for your text? If you are drawing over transparency then sub-pixel antialiasing doesn't work and when you

Re: Best text rendering settings?

2011-02-04 Thread Gideon King
surprised that there is a difference between the layouts when I draw it vs when the textview draws it. Thanks Gideon On 05/02/2011, at 3:54 AM, David Duncan wrote: On Feb 4, 2011, at 9:42 AM, Gideon King wrote: Sometimes the layer is transparent, and sometimes it will have a color drawn behind

Re: awakeFromNib Called Twice

2011-01-27 Thread Gideon King
Does something in your application load another nib file which has your MyDocument as the file's owner? Gideon On 28/01/2011, at 10:43 AM, Bruce Cresanta wrote: Hello, I have and NSDocument based application with the standard MyDocument document.I have a view declared as an IBOutlet

Re: Core data autosave

2011-01-21 Thread Gideon King
Hi Ken, I have also been wrestling with this one, and last year had the following suggestion from Ben: The problem with autosave is that NSDocument wants the current document to stay dirty. Save As pushes all the current edits to disk in the new document. Autosave is supposed to

Re: Core data autosave

2011-01-21 Thread Gideon King
hours debugging undo. I would second your opinion - I would never develop an app using the NSUndoManager now that I have seen the light ;-) Many thanks to Graham Cox for developing it. Regards Gideon On 22/01/2011, at 12:57 PM, Jerry Krinock wrote: On 2011 Jan 21, at 17:20, Gideon King

Getting a keystroke event to an NSTextView in another window.

2010-12-31 Thread Gideon King
I have a view which adheres to the NSTextInputClient protocol, and when people type into this view, I create another window with an NSTextView in it, which the user will continue typing into (this is necessary for some technical and user interaction reasons). This all works absolutely fine in

Re: Getting a keystroke event to an NSTextView in another window.

2010-12-31 Thread Gideon King
Never mind - found another way of handling it by implementing the marked text methods directly in my view and only creating the other window when the character composition is complete. Problem solved. On 01/01/2011, at 12:24 AM, Gideon King wrote: I have a view which adheres

CALayer and pixel alignment

2010-12-21 Thread Gideon King
I am drawing some CALayers, and use code like what I have below so I can draw exactly on pixels. When I draw it in my CALayer drawing code, it's not always pixel aligned. It's certainly better than if I had done no rounding, but still it is not correct. Is there something I'm not doing right?

Re: CALayer and pixel alignment

2010-12-21 Thread Gideon King
again. Regards Gideon On 22/12/2010, at 4:25 PM, Seth Willits wrote: On Dec 21, 2010, at 4:09 PM, Gideon King wrote: When I draw it in my CALayer drawing code, it's not always pixel aligned. You need to make sure the layer is aligned correctly too. The anchor point by default is {0.5, 0.5

Re: Image conversion to RGBA colors

2010-12-17 Thread Gideon King
Thanks for that pointer Ken - that works very nicely. Regards Gideon On 17/12/2010, at 2:09 PM, Ken Ferry wrote: On Thu, Dec 16, 2010 at 7:48 PM, Gideon King gid...@novamind.com wrote: Hi, I have an arbitrary (user supplied) image, and I want to get the RGBA values of each pixel

Re: Layer hosting views, geometryFlipped, and subviews

2010-12-16 Thread Gideon King
Oh wow! The voice of much pain speaking! Makes me want to cringe in the corner and say in a small voice but, but, but I just wanted to add a subview, sir. I got most of the way without having to use the geometryFlipped (using a transform to flip coordinates) - I had seen some of your, and

Image conversion to RGBA colors

2010-12-16 Thread Gideon King
Hi, I have an arbitrary (user supplied) image, and I want to get the RGBA values of each pixel of the image. I'm thinking that I should create it as an NSImage and then use the TIFFRepresentation to get it into an NSBitmapImageRep object, and then walk through and pick up the colors, but it

Layer hosting views, geometryFlipped, and subviews

2010-12-15 Thread Gideon King
Hi, I have a layer *hosting* view which has to use the geometryFlipped option so that it behaves correctly, and need to add an NSTextView subview for editing sometimes, and an ordinary custom view for editing at other times. I am having trouble working out where to place the subview. It just

Re: performSelectorOnMainThread fails second time through

2010-12-08 Thread Gideon King
That was the output for $rdi at the CGRunLoopWakeUp breakpoint immediately after the call to performSelectorOnMainThread... The output of po (void*)CFRunLoopGetMain() on the line after that is http://pastie.org/1358258 When I print $rdi at the CGRunLoopWakeUp in my mini test application, I do

Re: performSelectorOnMainThread fails second time through

2010-12-08 Thread Gideon King
Thanks Jonathan, but that's exactly what I did, and I couldn't replicate the problem in my test project, which is why I'm saying that something outside the multithreading is screwing things up somehow, but that could be anywhere in 23,000 lines of code, and I don't know what to look for. This

Re: performSelectorOnMainThread fails second time through

2010-12-08 Thread Gideon King
You are correct. They are two different things: Broken on CFRunLoopWakeUp: (gdb) po $rdi CFRunLoop 0x101e04390 [0x7fff70188ee0]{locked = false, wakeup port = 0x5c03, stopped = false, current mode = (none), common modes = CFBasicHash 0x101e043f0 [0x7fff70188ee0]{type = mutable set, count = 1,

Re: performSelectorOnMainThread fails second time through

2010-12-08 Thread Gideon King
0x114400a60 ?== 0x1029006e0 Assertion fails. The two are completely different as per previous results. FYI, I do not create any run loops explicitly in my application, and can't think of anything I am doing which would create one implicitly. Regards Gideon On 08/12/2010, at 8:55 PM, Dave

Re: performSelectorOnMainThread fails second time through

2010-12-08 Thread Gideon King
OK, I meant I'm not *running* any run loops myself - as per the threading documentation: For secondary threads, you need to decide whether a run loop is necessary, and if it is, configure and start it yourself. You do not need to start a thread’s run loop in all cases. For example, if you use a

Re: performSelectorOnMainThread fails second time through

2010-12-08 Thread Gideon King
So could this issue be something to do with the timing of the first time the threaded operation is run? During startup of the application, in an awakeFromNib, it calls a performSelector...afterDelay:0, and when that eventually fires, it triggers the thread to run. I would have thought that

performSelectorOnMainThread fails second time through

2010-12-07 Thread Gideon King
Hi, I'm trying to debug a really odd issue. I have a method that I run in a separate thread, and right at the end of the method, I call [anObject performSelectorOnMainThread:@selector(myMethod:) withObject:someData waitUntilDone:YES]; This works fine the first time I run it. The

Re: performSelectorOnMainThread fails second time through

2010-12-07 Thread Gideon King
Another data point on this: if I use waitUntilDone:NO, it doesn't even work the first time through. Responds to selector still returns YES. There are no error messages. On 08/12/2010, at 6:05 AM, Gideon King wrote: Hi, I'm trying to debug a really odd issue. I have a method that I run

Re: performSelectorOnMainThread fails second time through

2010-12-07 Thread Gideon King
the whole thing without using a separate thread for that method, and it worked fine both the first and second time. Gideon On 08/12/2010, at 6:33 AM, Charles Srstka wrote: On Dec 7, 2010, at 2:19 PM, Gideon King wrote: Another data point on this: if I use waitUntilDone:NO, it doesn't even work

Re: performSelectorOnMainThread fails second time through

2010-12-07 Thread Gideon King
I have completely commented out all the actions of the method that is executing in the thread. The only things it does are to create an autorelease pool, call a simple performSelectorOnMainThread, and release the pool. There is nothing else going on that I can see, and yet it still fails as per

Re: performSelectorOnMainThread fails second time through

2010-12-07 Thread Gideon King
Umm, as I mentioned, I have stripped back the multithreading part to virtually nothing and taken that code to a test application and it works there, and the rest of the application is 23,000 lines of code, which I can't post. In my main application, the following still fails (workerThread is

Re: performSelectorOnMainThread fails second time through

2010-12-07 Thread Gideon King
Interesting: 1. No. 2. No. Weird... Now I thought it would be interesting to try those calls before the thread was dispatched, and the terminate one worked, but the run loop stop didn't. I also tried the runloop stop one in my mini test application, and it didn't work there either, so am a

Re: performSelectorOnMainThread fails second time through

2010-12-07 Thread Gideon King
I have copied the source code to a different computer, and can confirm that it made no difference - the behaviour is the same. Regards Gideon ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: performSelectorOnMainThread fails second time through

2010-12-07 Thread Gideon King
Thanks for those excellent suggestions Dave (way above my head, but it's good to have the instructions to execute). 1. Current mode is kCFRunLoopDefaultMode 2. Nothing beginning with NSThread (same was true of my mini test app) 3. Yes, it broke at both those points, and there was something odd

Re: valueForKeyPath: not found in protocol

2010-11-16 Thread Gideon King
AFAIK, when something is referenced as a protocol like that, the *only* methods it knows about are the ones in the protocol. If you just cast the delegate to type id, you should be OK (I have encountered similar situations where this solution worked) [(id)delegate valueForKeyPath:... HTH

CAShapeLayer curved path animation

2010-11-06 Thread Gideon King
I'm using a CAShapeLayer, and the animation of the shape of the curved path I am using is doing really strange things (It seems to work fine on straight lines). I have tried: CGPathMoveToPoint(tempPath, NULL, startPoint.x, startPoint.y); CGPathAddQuadCurveToPoint(tempPath, NULL,

Re: CAShapeLayer curved path animation

2010-11-06 Thread Gideon King
PM, Gideon King wrote: I'm using a CAShapeLayer, and the animation of the shape of the curved path I am using is doing really strange things (It seems to work fine on straight lines). I have tried: CGPathMoveToPoint(tempPath, NULL, startPoint.x, startPoint.y

Re: CALayer renderInContext: performance

2010-11-03 Thread Gideon King
I haven't done any testing on performance, but are you using the opaque property of CALayer? Does that speed it up at all? On 04/11/2010, at 2:36 PM, Seth Willits wrote: renderInContext: can be rally slow (2 seconds to draw a tree into a context). It seems that every CALayer is

Problem using zPosition on layer backed views

2010-10-31 Thread Gideon King
I have a view with several subviews, all layer backed. These subviews are siblings. I want to bring one of them in front of the others, so I set the zPosition of the others to a zPosition of 1 and the one I want in front to a zPosition of 2. Nothing happens - the one I want in front is still

Re: Problem using zPosition on layer backed views

2010-10-31 Thread Gideon King
and maybe they were talking about UIViews... Oh well, I'll just have to sort the subviews array. Regards Gideon On 01/11/2010, at 6:35 AM, Kyle Sluder wrote: On Oct 31, 2010, at 5:13 AM, Gideon King gid...@novamind.com wrote: I have a view with several subviews, all layer backed

Re: Remove icon animation

2010-10-21 Thread Gideon King
NSShowAnimationEffect(NSAnimationEffectPoof, [NSEvent mouseLocation], NSZeroSize, NULL, NULL, NULL); Gideon On 22/10/2010, at 8:43 AM, gMail.com wrote: Hi, when you remove an icon from the Dock you get an animation fuff and a sound. Well, in some of my works I reproduced the same

Re: scaleUnitSquareToSize

2010-10-16 Thread Gideon King
You might like to check out http://apptree.net/gczoomview.htm which has all the basics of zooming handled, and could be pretty easily configured to do what you want. Regards Gideon On 17/10/2010, at 7:09 AM, k...@highrolls.net wrote: I am using scaleUnitSquareToSize to zoom out / zoom in on

Re: Smooth scrolling in NSScrollView

2010-10-15 Thread Gideon King
Thanks for the suggestion Uli. The subviews are layer backed views. I've stripped them down to simply drawing the color into a path - absolutely nothing unusual or complex there. Now this is rather embarrassing, but I found out that the cause of the visual slowdown was entirely due to running

Re: Smooth scrolling in NSScrollView

2010-10-15 Thread Gideon King
that will be 10.6+ only, so people will be encouraged to make the move. And with it the way it is, it still works on 10.5 - it's just faster the way we do it in 10.6. Gideon On 16/10/2010, at 1:09 AM, Keary Suska wrote: On Oct 15, 2010, at 8:50 AM, Gideon King wrote: But I also found

Smooth scrolling in NSScrollView

2010-10-14 Thread Gideon King
Hi, I am trying to get a large view to scroll smoothly in an NSScrollView using an animation on the scrollpoint. The first time I do this, the scrolling is quite jerky, especially when I get to places where there are subviews. Once it has shown the subviews (either by my previous manual

Re: Smooth scrolling in NSScrollView

2010-10-14 Thread Gideon King
my animation which uses NSAnimation and scrollPoint, but it has the same slight hesitation when it gets to showing the subviews just like what I see in my animation. Gideon On 15/10/2010, at 11:15 AM, Kyle Sluder wrote: On Thu, Oct 14, 2010 at 6:12 PM, Gideon King gid...@novamind.com wrote

Re: Adding subviews to collapsed splitview

2010-10-04 Thread Gideon King
Thanks for the tip Rainer - with that, I was able to track down the problem by adding the subview directly to the outer split view. Thanks again for providing such a useful component. Regards Gideon On 02/10/2010, at 5:48 AM, Rainer Brockerhoff wrote: Is there any special reason for you

Re: What does core data do during a Save As?

2010-10-03 Thread Gideon King
OK, I finally tracked down the problem, and have found workarounds for the resultant issues. As previously stated, as part of the migration carried out during a Save As, the awakeFromFetch gets called on all my managed objects. I had a method in one of the managed object classes which was

What does core data do during a Save As?

2010-10-01 Thread Gideon King
Hi, I'm still trying to sort out what is happening to my to-one relationships during a Save As operation (see Core data: Inverse relationships with subclasses thread for context if necessary, but this really is a standalone thread now) - it turns out that the subclasses/subentities questions

Re: What does core data do during a Save As?

2010-10-01 Thread Gideon King
... If there are any further suggestions as to how to debug this, I'm all ears. Regards Gideon On 02/10/2010, at 3:44 AM, Quincey Morris wrote: On Oct 1, 2010, at 09:03, Gideon King wrote: Hi, I'm still trying to sort out what is happening to my to-one relationships during a Save As operation (see

Adding subviews to collapsed splitview

2010-10-01 Thread Gideon King
Hi, I have a splitview (actually an RBSplitView), split into left and right, that I add another RBSplitView to at runtime in the right subview, and that split view that is added has a text view and an outline view as its subviews. All this works fine when the pane where I put the splitview that

Re: What does core data do during a Save As?

2010-10-01 Thread Gideon King
Following this discussion, I thought I would do a different test by making the back links transient and saying that they were not inverse links from the original ones, and making sure that they were manually set where required. But the validation errors still occurred, though now it is just the

Core data: Inverse relationships with subclasses

2010-09-29 Thread Gideon King
Hi, I have a bidirectional one to one relationship between two entities like this: Foo - Bar, and Foo has a subclass FooSub. All entities are concrete. Sometimes when I set the inverse relationship it's like this aBar.toFoo = aFoo, and this works fine, but when it's linking back to the

Re: Core data: Inverse relationships with subclasses

2010-09-29 Thread Gideon King
://sqlitebrowser.sourceforge.net For a solution, rework your schema to subclass FooSub directly from NSManagedObject. On Sep 29, 2010, at 9:28 AM, Gideon King wrote: Hi, I have a bidirectional one to one relationship between two entities like this: Foo - Bar, and Foo has a subclass FooSub. All

Re: Core data: Inverse relationships with subclasses

2010-09-29 Thread Gideon King
Sorry, I should have been clearer. It is a sub-entity which is implemented as a subclass. Regards Gideon On 30/09/2010, at 3:39 AM, Quincey Morris wrote: On Sep 29, 2010, at 06:28, Gideon King wrote: I would have thought it would be OK for the relationship to point to an instance

Re: Core data: Inverse relationships with subclasses

2010-09-29 Thread Gideon King
wrote: On 2010 Sep 29, at 09:19, jeremy wrote: For a solution, rework your schema to subclass FooSub directly from NSManagedObject. That might work. If it doesn't, On Sep 29, 2010, at 9:28 AM, Gideon King wrote: All entities are concrete … I would have thought it would be OK

Re: Core data: Inverse relationships with subclasses

2010-09-29 Thread Gideon King
: On Sep 29, 2010, at 15:30, Gideon King wrote: Sorry, I should have been clearer. It is a sub-entity which is implemented as a subclass. Hmm. I'd suspect a limitation of delete cascading rules, but that doesn't really fit with the error message your reported. Was that error text exactly

Re: Core data: Inverse relationships with subclasses

2010-09-29 Thread Gideon King
/09/2010, at 1:30 PM, Jerry Krinock wrote: On 2010 Sep 29, at 15:57, Gideon King wrote: Can I just clarify what you mean about working around a bug on 10.5? I do need this to work on 10.5. It was Quincey who tipped me off to this a few weeks ago: http://developer.apple.com/mac/library

Problems with starting editing outline view with Chinese marked text and diacriticals

2010-09-27 Thread Gideon King
Hi everyone, I have an outline view where I want to set things up so that when the user starts typing, it both starts editing and replaces the contents of the selected row with the typed character. Here is what I have been using: - (void)insertText:(id)aString { if ([self selectedRow]

Problem positioning the field editor for outline view

2010-09-26 Thread Gideon King
Hi, I have an outline view which uses variable row heights, and need to resize and position the field editor as the user edits the text. My code in my outline view is as follows: - (void)textDidChange:(NSNotification *)aNotification { NSInteger editedRow = [self editedRow]; if

Re: What would cause my animation's delegate methods to not be called?

2010-09-25 Thread Gideon King
As another data point, I have run exactly the same code on 10.5, and the animation delegate methods are called there. Gideon On 25/09/2010, at 12:46 PM, Gideon King wrote: Hi, I have a CALayer subclass with a CGPoint that I am animating using a CABasicAnimation. The layer is one of many

Three problems with CATiledLayer on 10.5

2010-09-25 Thread Gideon King
Hi All, I've run into three fairly basic problems with using CATiledLayer on 10.5. All of these things work fine in 10.6, but unfortunately I have to support 10.5 too. It is a layer hosting view in a scrollview, with a layer that is a CATiledLayer. 1. When my CATiledLayer is 5,000 x 5,000

What would cause my animation's delegate methods to not be called?

2010-09-24 Thread Gideon King
Hi, I have a CALayer subclass with a CGPoint that I am animating using a CABasicAnimation. The layer is one of many sublayers in a layer hosting view. I set up the animation to point to my layer as the delegate, and use addAnimation:forKey: to add the animation. The animation works fine, but

Re: CALayers - printing and flippedness

2010-09-14 Thread Gideon King
Thanks Scott, but I also tried with the layer being owned by the view, and nothing printed when I tried to print the view. I took it right back to a simple form where it just creates the layer and paints it red - works on screen but still doesn't print. - (void)awakeFromNib { CALayer

Re: CALayers - printing and flippedness

2010-09-14 Thread Gideon King
Thanks Matt - I was beginning to suspect that might be the case, but was hoping that there might be some workaround where I could get at the drawn content. I have done some performance testing and it appears that I'll need to go the route of pure layers for most of it (the animation got a bit

Re: CALayers - printing and flippedness

2010-09-14 Thread Gideon King
Absolutely brilliant, thanks Kyle - downloading it now... Gideon On 15/09/2010, at 4:08 AM, Kyle Sluder wrote: On Tue, Sep 14, 2010 at 10:12 AM, Gideon King gid...@novamind.com wrote: I have done some performance testing and it appears that I'll need to go the route of pure layers for most

Re: CALayers - printing and flippedness

2010-09-14 Thread Gideon King
Thanks Scott, but I also tried with the layer being owned by the view, and nothing printed when I tried to print the view. I took it right back to a simple form where it just creates the layer and paints it red - works on screen but still doesn't print. - (void)awakeFromNib { CALayer

CALayers - printing and flippedness

2010-09-13 Thread Gideon King
HI, I'm just getting started with some core animation work, and have run into a couple of issues pretty much straight away. The first is that I am trying to make sure that I will be able to print what I have on my view, but this doesn't seem to be working. I tried creating a layer backed

Re: using setPlaceholderString: in NSTextField

2010-09-06 Thread Gideon King
It's an NSTextFieldCell method not an NSTextField method. Try [[myTextField cell] setPlaceholderString:@whatever]; Regards Gideon On 07/09/2010, at 7:49 AM, C.W. Betts wrote: I would like to set it so that I can set the placeholder string programmatically. However, when I do it, I get a

Re: Register/Function Parm Mapping for 64-bit Was: isTemporaryID unrecognized selector…

2010-09-04 Thread Gideon King
documentation somewhere that tells us in plain language how to get useful information about the current method and args on 64 bit intel? (but then again, I've looked before and not found it) On 05/09/2010, at 5:50 AM, Jerry Krinock wrote: On 2010 Sep 03, at 21:25, Gideon King wrote: I was able

isTemporaryID unrecognized selector - how do I debug this?

2010-09-03 Thread Gideon King
Hi, I have a custom NSManagedObject subclass that I am having a problem with. When I delete the object, I get the isTemporaryID unrecognized selector sent to instance message being sent to the object being deleted - but ONLY if the object has been loaded from a file. If I have created it and

Re: isTemporaryID unrecognized selector - how do I debug this?

2010-09-03 Thread Gideon King
Thanks Jerry If I do a PO on the object that it says the message is being sent to, it shows the object that I deleted: 2010-09-04 13:16:35.818 NovaMind5TP[39867:a0f] -[NMTopicMapViewMO isTemporaryID]: unrecognized selector sent to instance 0x1046f51c0 (gdb) po 0x1046f51c0 NMTopicMapViewMO:

Re: isTemporaryID unrecognized selector - how do I debug this?

2010-09-03 Thread Gideon King
Brilliant! Found the problem and fixed it. The issue was that I was not registering the inverse of a relationship in a cache node for my atomic store. I was able to track it down by going to the maintainInverseRelationship:forProperty:oldDestination:newDestination: method call in the stack,

Best way to draw large tiled images?

2010-08-18 Thread Gideon King
I have a relatively large area on my NSView that I want to tile images into. I tried using CIAffineTile, but it gives me the following error: CoreImage: ROI is not tilable for even moderately large images (for small images, it works exactly as I want it to). I tried using [NSColor

Re: Core Data Bindings Issue

2010-08-18 Thread Gideon King
Is it just a case of making your controls continuous, or setting your bindings to continuously update values? On 19/08/2010, at 11:00 AM, Frank D. Engel, Jr. wrote: Then the value bindings of the NSSlider and NSCheckbox are both selectedWhatever.someField. The problem I am having is

Replacing undo manager in NSPersistentDocument sublclass

2010-08-17 Thread Gideon King
Just a quick question. I want to change my document to using the GCUndoManager so I can actually see what's going on with undo in my application. From the documentation, I would have thought that the following was sufficient in my NSPersistentDocument subclass's -init method:

Re: Using Apple icons

2010-08-16 Thread Gideon King
I was at a WWDC session several years ago (maybe about 5 years?) where exactly this question was asked of John Geleynse at one of the sessions. He said definitively that you could use the icons of applications that come with the system so long as their purpose was not altered (e.g. you could

Re: Updating timestamp on save = merge error

2010-08-11 Thread Gideon King
Thanks Jerry Yes, those are the things I had thought of - unfortunately the save type comes across as Save As for the first save too, and also I really should be setting it for a Save As anyway. I could get around it by using the merge policy, but that may well hide some other, real issues. It

Updating timestamp on save = merge error

2010-08-10 Thread Gideon King
I have a managed object I want to update with a last saved timestamp on save. I have the update done on the NSPersistentDocument -saveToURL:ofType:forSaveOperation:error: method. This works fine, except on save as. I know that the save as creates a new document and updates from the managed

KVO and Core data

2010-08-09 Thread Gideon King
Hi all, I have a KVO registration like this: [self addObserver:self forKeyPath:@toOne.attribute options:0 context:NULL]; I establish this on -awakeFromInsert or -awakeFromFetch, and have the corresponding removeObserver called on -willTurnIntoFault. The problem is that when I do a Save As on

Re: KVO and Core data

2010-08-09 Thread Gideon King
The objective is for me to be notified when toOne.attribute changes (either by toOne changing or by the attribute changing). Surely what I am doing is not getting the NSManagedObject to observe itself, but rather the observer is self and the observee is the to one relationship and it's

Re: KVO and Core data

2010-08-09 Thread Gideon King
Thanks Keary and Dave Yes, Ben helped me a lot with sorting out the underlying issues, which turned out to be a number of misunderstandings about what various methods in the atomic store are supposed to do, what is required, etc etc. And at the time, we had got to a point where we could save,

Re: KVO and Core data

2010-08-09 Thread Gideon King
that I only do the expensive calculations once for a bunch of related changes in the back end. Gideon On 10/08/2010, at 2:38 AM, Dave Fernandes wrote: On 2010-08-09, at 11:13 AM, Gideon King wrote: Dave's idea of using + (NSSet*)keyPathsForValuesAffectingKey may help in some situations

Re: KVO and Core data

2010-08-09 Thread Gideon King
OK, it's well after 3am now, so I'll leave more detailed analysis until after some sleep. The scenario is that of a simple Save As. As far as I am aware, I am not doing anything unusual in the process. I do not forcibly invalidate objects. It's a bit hard to track exactly what's happening, but

Re: KVO and Core data

2010-08-09 Thread Gideon King
Thanks for all the feedback guys. I really need to rethink how I use KVO throughout my application. I've read Mike Ash's post, and see the issues there - I'm surprised there aren't more places where the standard observations are tripping over each other. Time for some refactoring...

Re: Importing to core data persistent document

2010-08-05 Thread Gideon King
Thanks Quincey - of course I can do exactly what you say - pick up the fact that they are importing right at the start, ask them where they want the converted file, put it there and open it. Simple and foolproof. Sometimes I can't see the wood for the trees! setFileURL:nil always worked

Importing to core data persistent document

2010-08-04 Thread Gideon King
Hi, I'm having trouble importing into my application using Core Data. I have an NSAtomicStore based storage system. I can open and save my own files, but when someone wants to import from another format, I want to load the file and set the file name to nil so that I can save it as my own file

Re: Importing to core data persistent document

2010-08-04 Thread Gideon King
I think maybe my explanation could be clearer. Here's the flow: 1. User initiates import of file of type fred 2. I pick that up in -readFromURL:ofType:error:, and spawn a process which converts files of type fred to type myfiletype, the native file type of the application. Let's say that it is

Re: Importing to core data persistent document

2010-08-04 Thread Gideon King
Yes, I did think of putting it elsewhere, but I would have thought the problem would be the same. Say I overrode the NSDocumentController openDocumentWidhContentsOfURL:ofType:error: and had that do the conversion to my native document type, then call the NSDocumentController implementation, it

Re: Importing to core data persistent document

2010-08-04 Thread Gideon King
, at 19:48, Gideon King wrote: 1. User initiates import of file of type fred 2. I pick that up in -readFromURL:ofType:error:, and spawn a process which converts files of type fred to type myfiletype, the native file type of the application. Let's say that it is stored in a file called

Re: redraw problem

2010-07-29 Thread Gideon King
Yeah, hard to be of help without the source ...and you could use Quartz Debug to see what is actually being redrawn. (/Developer/Applications/Graphics Tools) On 30/07/2010, at 6:37 AM, Michael Dautermann wrote: On Jul 29, 2010, at 1:26 PM, Tony Romano wrote: I have a document based Cocoa

Equivalent of NSManagedObjectContextWillSaveNotification in 10.5?

2010-07-28 Thread Gideon King
Hi all, I need to do some stuff before my managed object context saves. I was successfully using NSManagedObjectContextWillSaveNotification in 10.6, but have to also support OS X 10.5, where that notification is not available. Was there some notification sent prior to 10.6? If the

Re: Equivalent of NSManagedObjectContextWillSaveNotification in 10.5?

2010-07-28 Thread Gideon King
Thanks Jerry, it is part of an NSPersistentDocument subclass. I get a bit confused about which save method(s) I would have to implement in my subclass, as there seem to be a number of save... methods and a number of writeTo... methods. The potential candidates seem to be: saveDocument:

WebView pagination for printing

2010-07-20 Thread Gideon King
Hi, my original quest was to print a table view with pagination and headers, but when I initially tried it, I didn't see how I could include the column headings in it, and found on the lists the suggestion to use a WebView and put the data in there to print it. When I tried it, I see that it

Re: WebView pagination for printing

2010-07-20 Thread Gideon King
OK, thanks Matt - I'll roll my own then. It's a real shame that printing support isn't there nicely for table views... Regards Gideon On 21/07/2010, at 5:46 AM, Matt Neuburg wrote: Then I'd suggest that you just write a view of your own that draws the way you want, and print that view.

<    1   2   3   4   >