Re: Removing Observers eats up memory

2016-01-25 Thread Markus Spoettl
On 25/01/16 18:47, Ken Thomases wrote: When the array changes, I remove all observers from these objects before re-observing the new objects. If at all possible, you should do this in a more targeted fashion. Add and remove observers only from the objects which were actually added or removed

Re: Dodgy Code - Low Level Memory Management Question!

2016-01-25 Thread Dave
Yes, A typeo, sorry! > On 25 Jan 2016, at 19:06, Jens Alfke wrote: > > >> On Jan 25, 2016, at 10:48 AM, Dave > > wrote: >> >> if ( myCachedObject == nil); > > The trailing semicolon on that line above must be a

Re: DeepCopy Arrays and Dictionaries

2016-01-25 Thread Quincey Morris
On Jan 25, 2016, at 08:50 , Dave wrote: > > Could I hold the data read here somewhere and use that to save re-reading the > file the second time around? Yes, you can, and it’s not an unreasonable thing to do. At the same time, it may not be your best course right now.

Re: Dodgy Code - Low Level Memory Management Question!

2016-01-25 Thread Quincey Morris
On Jan 25, 2016, at 10:48 , Dave wrote: > > myNewObject = [super initWithSomething: something]; This is a dangerous thing to do. At this point ‘self’ might not be a properly initialized object, if the ‘super’ call returns a different object from ‘self’. You’re better

Re: Dodgy Code - Low Level Memory Management Question!

2016-01-25 Thread Dave
Also, >> [LTWCacheManager addToCache: myID]; Should be [LTWCacheManager addID:myID withObject:myNewObject]; or some such (this is pseudo code really). > On 25 Jan 2016, at 19:06, Jens Alfke wrote: > > >> On Jan 25, 2016, at 10:48 AM, Dave

Re: DeepCopy Arrays and Dictionaries

2016-01-25 Thread Dave
Hi Again, > The *easy* way to do a deep copy is in fact to archive the root object and > unarchive the result. Yes, I’ve come to that conclusion myself thinking about it. Apart anything else it offloads the problem nicely. In my case, I don’t need to archive it at all, I just need to load

Re: delete stock apps

2016-01-25 Thread Alex Zavatone
On Jan 25, 2016, at 1:16 AM, Rick C. wrote: > Does anyone know if there’s a way to delete stock apps on 10.11 without > disabling SIP and rebooting the machine? Or, is there a way to disable SIP > without rebooting? Thanks! > ___ SIP? SIP means

Re: delete stock apps

2016-01-25 Thread Charles Jenkins
System Integrity Protection, OS X’s new feature to (IIRC) keep malware from altering trusted default programs. --  Charles On January 25, 2016 at 12:07:59, Alex Zavatone (z...@mac.com) wrote: On Jan 25, 2016, at 1:16 AM, Rick C. wrote: > Does anyone know if there’s a way to delete stock

Re: delete stock apps

2016-01-25 Thread Clark S. Cox III
> On Jan 24, 2016, at 22:16, Rick C. wrote: > > Does anyone know if there’s a way to delete stock apps on 10.11 without > disabling SIP and rebooting the machine? No. > Or, is there a way to disable SIP without rebooting? Thanks! No. >

Re: Removing Observers eats up memory

2016-01-25 Thread Gary L. Wade
You should look more at your design. Having that many objects being unobserved and reobserved (your word although in the context of new objects) reminds me of what I've called a genocidal refresh, an antipattern that can be fixed by only refreshing (or in your case observing) the things

Re: Removing Observers eats up memory

2016-01-25 Thread Ken Thomases
On Jan 25, 2016, at 3:10 AM, Markus Spoettl wrote: > > I have a view controller with a table view that is bound to an array > containing around 1000-1 model objects. The same view controller > registers itself as observer of all the objects' properties. These

Dodgy Code - Low Level Memory Management Question!

2016-01-25 Thread Dave
Hi All, This is a bit dodgy so bear with me. I have a class that is a subclass of a third party framework. This is hard to explain, but I’m trying to make it into a singleton of kinds. When the framework wants an object of this particular class it alloc/init’s a new one. This calls the

Re: DeepCopy Arrays and Dictionaries

2016-01-25 Thread Sandor Szatmari
Caching the result could save the re-read. However, if your data store (the file) is not opaque to the user someone will edit it and then your cache is out of sync with the file. That may or may not be desirable, but at least it's something to incorporate into the design. Sandor > On Jan

Re: Removing Observers eats up memory

2016-01-25 Thread Quincey Morris
On Jan 25, 2016, at 01:10 , Markus Spoettl wrote: > > Has anyone any idea how the removing of observers can cause this kind of > death spiral? Genocidal refreshes aside, are you absolutely sure that you’re always removing/adding observers on an appropriate thread?

Re: DeepCopy Arrays and Dictionaries

2016-01-25 Thread Dave
There are two copies, the MASTER, this is never touched, I generate this from the initial load. At some later stage, something gets woken up saying that Network in online. When this happens I want a R/W Network that gets saved separately when the Network goes offline. This file then gets used

Re: The PID of an Application?

2016-01-25 Thread Jens Alfke
> On Jan 25, 2016, at 9:53 AM, Dave wrote: > > Is the PID of an Application 120% cast-iron guaranteed not to change during > the Application’s life span? Yes. The PID is what uniquely identifies a process during its lifespan. (Technically it’s possible for running

Re: Removing Observers eats up memory

2016-01-25 Thread Richard Charles
> On Jan 25, 2016, at 2:10 AM, Markus Spoettl wrote: > > Sometimes (on El Capitan) this removing of observers causes my app to freeze > and eat memory at an alarming rate. Sometimes this spirals completely out of > control until all memory is exhausted, sometimes it

The PID of an Application?

2016-01-25 Thread Dave
Hi, Is the PID of an Application 120% cast-iron guaranteed not to change during the Application’s life span? All the Best Dave ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Re: Removing Observers eats up memory

2016-01-25 Thread Markus Spoettl
On 25/01/16 20:23, Ken Thomases wrote: This is interesting. When I implement this property in the proxy object, the problem goes away (at least I wasn't able to duplicate it so far). Turn off the implementation, it comes back. Not really sure what this tells me, though. Implementing the

Re: Removing Observers eats up memory

2016-01-25 Thread Markus Spoettl
On 25/01/16 17:31, Gary L. Wade wrote: You should look more at your design. Having that many objects being unobserved and reobserved (your word although in the context of new objects) reminds me of what I've called a genocidal refresh, an antipattern that can be fixed by only refreshing (or in

Re: Removing Observers eats up memory

2016-01-25 Thread Markus Spoettl
On 25/01/16 18:34, Quincey Morris wrote: On Jan 25, 2016, at 01:10 , Markus Spoettl > wrote: Has anyone any idea how the removing of observers can cause this kind of death spiral? Genocidal refreshes aside, are you absolutely sure

Re: Removing Observers eats up memory

2016-01-25 Thread Ken Thomases
On Jan 25, 2016, at 3:22 PM, Markus Spoettl wrote: > > Thanks for the suggestion and explanation, I would never have thought of > using this. You're welcome. I'm glad I could help. > I wonder if there's a downside to implementing this in all my model objects >

Re: Obj-C - your thoughts on hiding data members?

2016-01-25 Thread Greg Parker
> On Jan 24, 2016, at 3:55 PM, Graham Cox wrote: > > In Objective-C 2, data members can be moved into a @interface MyClass () > section which lives in the .m file, rather than in the header file as in the > classic case. This makes sense - those data members are

Re: Dodgy Code - Low Level Memory Management Question!

2016-01-25 Thread Jens Alfke
> On Jan 25, 2016, at 10:48 AM, Dave wrote: > > if ( myCachedObject == nil); The trailing semicolon on that line above must be a typo. It’s going to cause the test to be ignored and the block below to always run. > { > self = myNewObject; >

Re: Removing Observers eats up memory

2016-01-25 Thread Ken Thomases
On Jan 25, 2016, at 1:05 PM, Markus Spoettl wrote: > > When I break in the debugger I end up in various different library functions > concerned with hash tables and the like, such as > > #00x7fff9ddc6d03 in weak_entry_for_referent(weak_table_t*, >

Removing Observers eats up memory

2016-01-25 Thread Markus Spoettl
Hi, I have a view controller with a table view that is bound to an array containing around 1000-1 model objects. The same view controller registers itself as observer of all the objects' properties. These objects are actually proxies for other model objects and are created by my view

Re: Diff view framework?

2016-01-25 Thread Stephen J. Butler
How about using a webkit view and one of these diff2html scripts: http://stackoverflow.com/questions/641055/diff-to-html-diff2html-program On Mon, Jan 25, 2016 at 3:08 AM, Jonathan Guy wrote: > Hi all > Does anyone know of a cocoa framework which provides a view for

Diff view framework?

2016-01-25 Thread Jonathan Guy
Hi all Does anyone know of a cocoa framework which provides a view for showing file differences? I am aware there are plenty of free and paid apps to do this but I really need this view to be built into my app if possible. Thanks for any help. Jonathan

Fwd: Stubborn link error - can't find a framework.

2016-01-25 Thread Motti Shneor
Hi. I have an OS-X project with several targets. I have a few private frameworks (say F1 and F2) then a higher level private framework (F3) which depends on the first 2, and links against them, and then some “top level” code-bundle target (actually a system preferences panel) that should