Can't get NSManagedObject subclass to release objects

2013-08-09 Thread Rick Mann
iOS. I have a Core Data entity called Job. It creates a transient object Processor and has a strong reference to it. The Processor can consume a fair bit of memory. A Job also has zero or more Sweeps. My app has a notion of an active job, of which there's only one at any given time, and

NSToolbar settings not saved

2013-08-09 Thread Pax
Okay, I think that this might be a weird one. I've read the documentation, and I've implemented a toolbar for my document based application. For the most part, it works perfectly but its settings don't seem to be getting saved. For example: 1. If I have x many windows open and I add an item

Re: Can't get NSManagedObject subclass to release objects

2013-08-09 Thread Jerry Krinock
On 2013 Aug 09, at 00:59, Rick Mann rm...@latencyzero.com wrote: I've tried calling -refreshObject:mergeChanges: on it, but that only seems to reduce the retain count on my object by one. I presume that Xcode's Product Profile Leaks is available in iOS projects. You could run it and

Re: NSToolbar settings not saved

2013-08-09 Thread Graham Cox
Are you setting up your toolbar in IB, or in code? If in IB, none of the methods you list are needed - it will work without them. In fact, you do not need to write any code at all to fully support toolbars unless you're doing something unusual. The documentation goes into a lot of detail that

Re: NSToolbar settings not saved

2013-08-09 Thread Michael Starke
I'm using a similar setup, that is I allocate and place the toolbar in code, create all toolbar items with the delegates. I'm supporting the same delegates as you do (defaults, allowed) and do not get the described behavior. 1. Same here 2. New window has custom toolbar as I did modify it 3.

Re: NSToolbar settings not saved

2013-08-09 Thread Michael Starke
Correction: I'm not using - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag but other than that, same usage as you. On 09.08.2013, at 13:22, Pax 45rpmli...@googlemail.com wrote: Okay, I think that this might

Re: Can't get NSManagedObject subclass to release objects

2013-08-09 Thread Dave Fernandes
As Jerry said, you can't force the MOC to release a managed object. However, you CAN force it to turn managed objects into faults. Then in your override of -[NSManagedObject didTurnIntoFault], you can release the transient object. You will have to recreate the transient object on demand if the

Re: Can't get NSManagedObject subclass to release objects

2013-08-09 Thread Jerry Krinock
On 2013 Aug 09, at 06:53, Dave Fernandes dave.fernan...@utoronto.ca wrote: However, you CAN force it to turn managed objects into faults. Then in your override of -[NSManagedObject didTurnIntoFault], you can release the transient object. Yes, it looks like that and

Re: NSToolbar settings not saved

2013-08-09 Thread Pax
Mostly in code. I've added a toolbar in IB, and hooked it up to an NSToolBar object in my code - and then I use that NSToolBar object to set up my toolbar. I am doing some unusual things (mainly to do with the validation of items, and subtle changes to the icon to give the user additional

Web development using Objective-C and Cocoa

2013-08-09 Thread Maxthon Chan
Hi everyone. Have anyone of you written any Web application (i.e. code that runs on a Web server) in Objective-C? I am currently working on CGIKit (version 6), an open-source Web development framework for Objective-C, sort of a WebObjects replacement. I am here to ask you for any advices (or

Re: Web development using Objective-C and Cocoa

2013-08-09 Thread Maxthon Chan
Well I am regarding writing server-side script. It seemed to me that Cappuccino cannot handle server-side tasks well (unless with node.js) but I can do lots of heavy lifting in Objective-C that is compiled with clang into native code - for example, can you fine-tune tight loops in good old

Dispatch IO

2013-08-09 Thread Seth Willits
I threw dispatch_io at a problem and was amazed at the result: superb performance! My only question is about memory usage. In my case I am only doing streamed writes to a file. Since dispatch_io_write is async, there's the potential for me to supply data to dispatch_io faster than my hard

Re: Dispatch IO

2013-08-09 Thread Quincey Morris
On Aug 9, 2013, at 10:31 , Seth Willits sli...@araelium.com wrote: One of my thoughts is to set the handler interval and check for the data size to be over my memory limit and if it is, set a flag and stall generation until it drops back below the memory limit which I would know the next

Re: Dispatch IO

2013-08-09 Thread Greg Parker
On Aug 9, 2013, at 11:09 AM, Quincey Morris quinceymor...@rivergatesoftware.com wrote: Incidentally, keep in mind (from an earlier discussion on this list) that GCD semaphores initialized with a count greater than 0 will complain (incorrectly, IMO) if the current count is not the same as the

Re: Dispatch IO

2013-08-09 Thread Seth Willits
On Aug 9, 2013, at 11:09 AM, Quincey Morris wrote: One of my thoughts is to set the handler interval and check for the data size to be over my memory limit and if it is, set a flag and stall generation until it drops back below the memory limit which I would know the next time the handler

Re: Dispatch IO

2013-08-09 Thread Quincey Morris
On Aug 9, 2013, at 12:37 , Greg Parker gpar...@apple.com wrote: The assumption is that if you're destroying the semaphore and the count doesn't match then there is some worker still in progress that is going to signal the dead semaphore later. Detecting this error at semaphore destruction

Re: Can't get NSManagedObject subclass to release objects

2013-08-09 Thread Rick Mann
Thanks. There were two great bits of information in there: the MOC references objects weakly, and objects reference related objects strongly (which is broken by the -[refreshObject:merge: false] call). On Aug 9, 2013, at 07:58 , Jerry Krinock je...@ieee.org wrote: On 2013 Aug 09, at 06:53,