Re: Core Data and ARC crasher and workaround

2012-04-18 Thread Michael Link
I'm running into a similar situation except it's not crashing at the time of dealloc but at some later time. Here's the rundown of what I see happening. 1. Global parent (non main-thread MOC) is alloc'd 2. Child1 (main-thread) MOC is alloc'd 3. Child2 (main-thread) MOC is alloc'd 4. Child1 MOC is

Re: Core Data nested managed object contexts and frequent deadlocks

2012-01-13 Thread Michael Link
On Jan 13, 2012, at 3:45 PM, Chris Hanson wrote: > On Jan 13, 2012, at 12:39 AM, Michael Link wrote: > >> the docs seem to indicate that using a main thread concurrency type MOC on >> the main thread without performBlock: is fine. > > It is, otherwise you couldn&#

Core Data nested managed object contexts and frequent deadlocks

2012-01-13 Thread Michael Link
I have a parent MOC setup with NSPrivateQueueConcurrencyType and a persistent store coordinator set, it has a child MOC setup with NSMainQueueConcurrencyType. The idea being most of the long hard work and saves can be done on the private MOC freeing the main thread from blocking the UI. Unfortu

NSURLConnection using setDelegateQueue deadlocks

2011-12-19 Thread Michael Link
Is there some trick to getting NSURLConnection to work with an NSOperationQueue on iOS 5, and perhaps Lion but I haven't tried it there? It seems that it causes a deadlock every time just after the last delegate message has been sent (connectionDidFinishLoading:). The project is using ARC. The

drag and drop not working between windows on 10.7

2011-08-29 Thread Michael Link
I have a document based app that has a source list (NSOutlineView) that allows drag and drop on itself or another source list (same class) in a different document in the same application. Everything works on 10.6, in 10.7 drags to the same NSOutlineView are validated as I expect. Drags to the o

CALayers are rooted in GC only apps

2011-07-09 Thread Michael Link
In an application that is built gc-only it seems that any CALayers added as sublayers to an NSView are rooted (perhaps by CFRetain) and if those layers have any references to the NSView that is hosting them then they can cause a memory leak. I have a view that has sublayers that accept completi

Core Data: stop object from firing fault?

2011-06-30 Thread Michael Link
Is there anyway to stop an NSManagedObject from firing a fault, say because it's actually been deleted? For instance if an object is created on the main thread and is then punted to a background thread and deleted (in a separate context of course) then the changes are merged back to the main th

Re: CoreData migration opens ~ file by mistake

2011-03-21 Thread Michael Link
I'm running into this same problem on 10.6 when the migration is automatic or manual. I can always reproduce it with manual migration. After migration and the document window is open and the application is made inactive and active again you may notice the title of the document has suddenly chan

Core Data Migration Error

2011-01-16 Thread Michael Link
I keep getting this error when trying to migrate a sql store: -[Document configurePersistentStoreCoordinatorForURL:ofType:modelConfiguration:storeOptions:error:] Error NSCocoaErrorDomain 134110 { NSUnderlyingException = "I/O error for database at /Users/mlink/Desktop/Untitled.db.new. SQLit

NSHTTPCookieStorage

2010-11-11 Thread Michael Link
Did something recently change with sharedHTTPCookieStorage no longer sharing session cookies? -- Michael___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators

NSPersistentDocument and canConcurrentlyReadDocumentsOfType

2010-10-12 Thread Michael Link
In the documentation for NSPersistentDocument's method -managedObjectModel it says the following addition in a subclass can be used to improve efficiency if all the documents share the same model. > - (id)managedObjectModel { > static id sharedModel = nil; > if (sharedModel == nil) { >

non-pointer instance variable

2010-07-15 Thread Michael Link
Is it necessary to use objc_atomicCompareAndSwapInstanceVariableBarrier when setting an instance variable such as an NSInteger in a GC app? Or would OSAtomicCompareAndSwap64Barrier be more appropriate? -- Michael___ Cocoa-dev mailing list (Cocoa-dev@l

atomic properties and KVC

2010-07-14 Thread Michael Link
If I have a property declared and synthesized (e.g. @property BOOL foo; and I use a KVC method to access the value of foo (e.g. [object valueForKey:@"foo"]; is it still accessed atomically? -- Michael ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple

Re: first responder being clobbered

2009-10-27 Thread Michael Link
26, 2009, at 10:59 PM, Graham Cox wrote: On 27/10/2009, at 2:55 PM, Michael Link wrote: Is there a different solution to getting a first responder in a table cell and not having it resign on 3.1? I'm unfamiliar with the iPhone version of Cocoa and whether its rules are different, but

first responder being clobbered

2009-10-26 Thread Michael Link
I have a custom UITableViewController that uses a custom cell that displays a text field. I have this method added to the table view controller to set the text field as first responder - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; MLPropertyEditing

embedding framework in Application bundle?

2009-08-06 Thread Michael Link
I'm trying to work around a problem where the latest update of Mac OS X (10.5.8) has a broken XQuery.framework. I've discovered that replacing the XQuery.framework on Mac OS X 10.5.8 with a version from Mac OS X 10.5.7 solves all the problems. I'd like to embed the XQuery.framework from Mac

Re: Mac OS X 10.5.8 update breaks tokenize function in -[NSXMLNode objectsForXQuery:error:]

2009-08-06 Thread Michael Link
After some more investigation I've discovered that XQuery was updated in Mac OS X 10.5.8 as part of a security vulnerability in the PCRE library which it includes. http://support.apple.com/kb/HT3757 (scroll to bottom of page) Which also explains why all XQuery functions using regular express

Mac OS X 10.5.8 update breaks tokenize function in -[NSXMLNode objectsForXQuery:error:]

2009-08-05 Thread Michael Link
I noticed that the recent update of Mac OS X 10.5.8 breaks compatibility with previous versions regarding XQuery statements in NSXMLNode, specifically using the XQuery function tokenize. I originally reported this bug against a future version of Mac OS X and now seems to have slipped into t

garbage collection and pointer to object

2009-05-21 Thread Michael Link
I have a class with the following methods - (void)save { NSError* error = nil; if (![self save:&error]) { NSLog(@"caught error during save: %@", error); } } - (BOOL)save:(NSError**)error { if (![_thread isCancelled]) { retu

auto garbage collection race condition?

2009-01-14 Thread Michael Link
I'm running into a scenario where it appears the application is allocating memory faster than it can be reclaimed by garbage collection. I believe this is how it happens. There are a pool of threads that are used to collect some data as it is collected (by using NSXML* objects, XQuery). In

agc error for object ... Deallocating a non-block

2008-12-31 Thread Michael Link
When I see an error on the console that looks like this: Test(22389,0xb0103000) malloc: *** free() called with 0x1f29ba00 with refcount 0 Test(22389,0xb0103000) malloc: *** auto malloc[22389]: agc error for object 0x1f29ba00: Deallocating a non-block What exactly does 'Deallocating a non-bl

Re: copy object in kCFAllocatorMallocZone to scanned zone?

2008-12-23 Thread Michael Link
On Dec 23, 2008, at 1:19 PM, Michael Link wrote: I have a situation with something like this is going on: CFHTTPMessageRef response = CFHTTPMessageCreateEmpty(kCFAllocatorMallocZone, FALSE); CFHTTPMessageAppendBytes(response, bytes, length); if

copy object in kCFAllocatorMallocZone to scanned zone?

2008-12-23 Thread Michael Link
I have a situation with something like this is going on: CFHTTPMessageRef response = CFHTTPMessageCreateEmpty(kCFAllocatorMallocZone, FALSE); CFHTTPMessageAppendBytes(response, bytes, length); if (CFHTTPMessageIsHeaderComplete(response)) { CFIndex statusCode =

garbage collection memory leak

2008-12-17 Thread Michael Link
I'm trying to track down a memory leak even though I'm using garbage collection. I was curious what the "rc:" field means when using "info gc-roots" in gdb? It doesn't seem to correlate to the Retain Count when inspecting an address in Instruments and it doesn't seem to always correlate to

GC and propertyListFromData:mutabilityOption:format:errorDescription:

2008-11-10 Thread Michael Link
The documentation for propertyListFromData:mutabilityOption:format:errorDescription: says that errorDescription needs to be released by the caller. In a garbage collected environment is this still the case? Should NSMakeCollectable() be called on errorDescription? Is it safe to call NSMak

Re: -[NSGarbageCollection disableCollectorForPointer:] ?

2008-10-15 Thread Michael Link
SELECTOR_REFERENCES_4-"L076$pb"(%ebx), %edx movl%edx, 4(%esp) movl%eax, (%esp) call_objc_msgSend leal12(%esi), %edx movl%edx, 4(%esp) movl%eax, (%esp) call_objc_assign_strongCast … -Ken Cocoa Frameworks On Wed, Oct 15, 2008 at 9:32 AM, Mich

Re: -[NSGarbageCollection disableCollectorForPointer:] ?

2008-10-15 Thread Michael Link
ough I get confused with the pointer functions too. -Ken On Tue, Oct 14, 2008 at 9:43 PM, Michael Link <[EMAIL PROTECTED]> wrote: I have a situation where I create an NSPointerArray on the stack by: pointers = [NSPointerArray pointerArrayWithOptions:NSPoint

-[NSGarbageCollection disableCollectorForPointer:] ?

2008-10-14 Thread Michael Link
I have a situation where I create an NSPointerArray on the stack by: pointers = [NSPointerArray pointerArrayWithOptions:NSPointerFunctionsStrongMemory| NSPointerFunctionsOpaqueMemory|NSPointerFunctionsOpaquePersonality]; I then go about adding a few objects a selector and a pointer (contex

Core Data and Garbage Collection

2008-09-09 Thread Michael Link
I'm running an application with the Core Data thread assertions on and am running into some issues on the garbage collection thread. On the GC thread (#2 usually in GDB), finalizeOneObject() is running the finalize method of an NSTextValueBinder object. This object is bound to the attribute

Re: NSArrayController bindings and preservesSelection

2008-08-30 Thread Michael Link
. -- Michael On Aug 30, 2008, at 10:00 PM, Michael Link wrote: I have a situation where I have a source list whose selection controls the bindings of an NSArrayController, and thus the content of a view. Depending on what source a user selects in the source list the NSArrayController can have

NSArrayController bindings and preservesSelection

2008-08-30 Thread Michael Link
I have a situation where I have a source list whose selection controls the bindings of an NSArrayController, and thus the content of a view. Depending on what source a user selects in the source list the NSArrayController can have its MOC bound and a fetch predicate set or its contentSet bo

NSPersistentDocument SQLite and Garbage Collection hang during save

2008-07-24 Thread Michael Link
I've run into a problem when using NSPersistentDocument that uses a SQLite store and the application uses garbage collection. After one or more saves on a document the application will hang while trying to perform a save. A backtrace indicates that the hang occurs in a sqlite function that

Re: Core Data merge and "statement is still active" error?

2008-06-05 Thread Michael Link
On Jun 5, 2008, at 4:37 PM, Ben Trumbull wrote: On Jun 3, 2008, at 8:15 PM, Michael Link wrote: Is there a reason you're not using Core Data's - mergeChangesFromContextDidSaveNotification: ? If the object is modified (inserted, update, or deleted), you should pass

Re: Core Data merge and "statement is still active" error?

2008-06-03 Thread Michael Link
On Jun 3, 2008, at 5:52 PM, Ben Trumbull wrote: Michael, This error is almost always a multi-threading problem. When you used the _debug version of Core Data, did you enable the threading assertions with the user default -com.apple.CoreData.ThreadingDebug 3 ? Yes, I also see this in t

Core Data merge and "statement is still active" error?

2008-06-03 Thread Michael Link
The goal is to do insertions/changes/deletes on a background thread and then after a save merge those changes into the main threads managed object context and thus update the UI. I have a situation where NSManagedObjectContextDidSaveNotification is forwarded from a background thread's manag

transient attributes of NSManagedObject reflected in isUpdated

2008-04-29 Thread Michael Link
I noticed that if you have a transient attribute in an NSManagedObject and update that attribute then isUpdated will return that the object has unsaved changes. I suppose this makes some sense if the attribute is actually defined in the entity. On the other hand if the managed object has a