[iPhone} Exception After Creating First Object

2009-10-08 Thread Steve Steinitz
Hello, My Core Data iPhone app throws an NSRangeException when I call (or when the OS calls) [moc processPendingChanges] after I create the first object of a given entity. I've commented-out my interface down to the bone and put breakpoints on remaining methods. It appears that none of my

re: [iPhone} Exception After Creating First Object

2009-10-10 Thread Steve Steinitz
Hello, I got a couple of private messages about breakpoints and stacktraces, which, of course, I had done before I posted my question. That's how I discovered that [mod processPendingChanges] led to an exception when adding to an empty database table. I learned a little more about the exce

re: [iPhone} Exception After Creating First Object

2009-10-11 Thread Steve Steinitz
Hi Ben, Thanks for your reply. On 10/10/09, Ben Trumbull wrote: Does anyone know how to make [self.tableView endUpdates] less vulnerable when the associated database table is empty? Which version of iPhoneOS SDK are you building for ? This sounds like an issue that was fixed in 3.1. Ah,

Re: NSFetchedResultController bug?

2009-10-13 Thread Steve Steinitz
Hello, On 13/10/09, cocoa-dev-requ...@lists.apple.com wrote: When I add these to a secondary managed object context (MOC) and then merge these changes with the primary MOC, the application crashes with the following error: 2009-10-13 02:59:12.787 MyApp[43049:207] *** Terminating app due t

Re: NSTreeController, Core Data and root objects

2009-11-05 Thread Steve Steinitz
Hi Rob, On 5/11/09, Rob Keniger wrote: as I add a new item to the top level it fails because the tree controller does not assign the "invisible" root item as the parent of the new item. Fritz's idea looks much cooler (I might try it) but for a clumsier solution, have you written your own

Re: NSTreeController, Core Data and root objects

2009-11-05 Thread Steve Steinitz
Hi Rob, Rob Keniger wrote What I've tried, which does seem to work, is overriding -insertObject:atArrangedObjectIndexPath: and setting the parent explictly if the item is being inserted at the top level: ... Can anyone see anything wrong with this? I don't see anything wrong. In fact, it

re: CoreData database sharing and migration

2010-03-17 Thread Steve Steinitz
Hello On 17/3/10, cocoa-dev-requ...@lists.apple.com wrote: Do you mean "more than one application simultaneously on more than one physical computer over NFS/AFP/SMB" ? Don't do that. When did that become the official policy, Ben? I'm doing that with some success. For the past three years,

re: CoreData database sharing and migration

2010-03-22 Thread Steve Steinitz
Hi Ben, Thank you for your detailed and candid reply. I have some comments and questions on a few points, below... On 18/3/10, Ben Trumbull wrote: there wasn't a good solution for multiple machines simultaneously accessing an SQLite db file (or most other incrementally updated binary file f

Getting Computer Name

2010-06-20 Thread Steve Steinitz
Hello, I've found several examples of getting the computer Name but some give warnings about making a pointer from an integer and they all fail with signal EXC_BAD_ACCESS here objc_msgSend_vtable5 _NSDescriptionWithLocaleFunc _CFStringAppendFormatAndArgumentsAux _CFStringCreat

Re: Getting Computer Name

2010-06-20 Thread Steve Steinitz
Hi Paul, Thanks for your reply. On 20/6/10, Paul Sanders wrote: I use #1 and it works fine for me. Note that SCDynamicStoreCopyComputerName might return NULL, and don't forget to CFRelease temp. OK, thanks. In the case of #1, what is the NSLog statement that is failing? And I take it tha

Re: Getting Computer Name

2010-06-20 Thread Steve Steinitz
Hi Paul, On 20/6/10, Paul Sanders wrote: It looks like SCDynamicStoreCopyComputerName is not prototyped correctly so the compiler assumes it returns an int. In what I assume is a 64-bit build this will lose the top 32 bits of the CFStringRef. Yes, your diagnosis holds water. I'm building an

Re: Getting Computer Name

2010-06-20 Thread Steve Steinitz
Hi Paul, On 20/6/10, Paul Sanders wrote: Are you #including ? I wasn't. I added it. Were you wondering if it would make a difference? Well, yes. Default return type is int. In fact I'm suprised you didn't get a warning about the function being undefined. My Mac is powered off or I wou

Re: Getting Computer Name

2010-06-20 Thread Steve Steinitz
Hi Jonathan, Thanks for replying. On 20/6/10, Jonathan Mitchell wrote: >> Could I have done something to my project to break toll-free bridging? > You can't break toll free bridging. > The NSObject and CF type collaborate to route objects and function calls > appropriately. Thanks for that

Re: Getting Computer Name

2010-06-20 Thread Steve Steinitz
Thanks Jonathan Mitchell, John Joyce, Paul Sanders and Jens Alfke. John: Bingo! CSCopyMachineName() works perfectly. To answer your question, I want a human-readable machine identifier, but one that's not tied to the hardware, the way, say, serial number is. Our Core Data point-of-sale sys

Re: Getting Computer Name

2010-06-20 Thread Steve Steinitz
Hi Kyle, On 20/6/10, Kyle Sluder wrote: to temporarily hide sales that are in progress on other machines. I currently do that but in a more awkward way, Might you instead want to make a sale an atomic thing? Perform the sale on a scratch MOC, and then when the sale is complete (or voided), me

Re: Getting Computer Name

2010-06-21 Thread Steve Steinitz
Hi John, not to question your own algorithms, but you may also want to consider checking the MAC address (ethernet) I see what you are saying but I want to keep specific hardware out of the equation. I want to be able to swap a new Mac Mini in at any time. The computer name is a convenienc

Re: Getting Computer Name

2010-06-21 Thread Steve Steinitz
Hi Kyle, On 20/6/10, Kyle Sluder wrote: Be aware that as of 10.6, this is an officially unsupported configuration, prone to breaking in point releases as happened in 10.6.2. Yes, we are more careful with Mac OS X updates now. See Ben Trumbull's post here for the nitty-gritty: http://lists.a

Re: Core Data Xcode 4 question

2011-09-01 Thread Steve Steinitz
Hi Andrew, I get this mailing list in digest form so hope I'm not too late to chime in with what a wonderful tool Jonathan “Wolf” Rentzsch has given to us and has continued to maintain over the years. I never did use the Xcode plugin and so am used to the command line interface. Install moge

Re: NSArrayController Update Delay

2011-10-13 Thread Steve Steinitz
Hi Richard, The advice you've received already is more sound than what I'm about to tell you. But my crude technique has solved the problem you mention and similar problems. I wrote the following class method on a utility class into which I throw stuff: + (void) waitUntilEndOfNextRunLoop {

Re: Mac core data and iCloud example app

2011-10-17 Thread Steve Steinitz
Hi Martin, Please forgive me for throwing in a comment that won't help you much. I'm happy you've started this thread. For me there is no more interesting topic. Over the coming months I'll be looking closely at Core Data + iCould, and would enjoy staying in touch with you. Core Data is wo

Re: Core Data: Determine if managed object is deleted

2011-10-21 Thread Steve Steinitz
Hi Jerry, On 21 Oct 11, at 2:53pm, cocoa-dev-requ...@lists.apple.com wrote: > In other words, they should have named that method -isDeletedForSure, to > indicate that the NO result is not reliable. Funny. > Anyhow, today I fixed a problem by using this instead > > BOOL isDeleted ; > isDeleted

Re: Troubles with Bold and Italic fonts - Cocoa

2011-11-13 Thread Steve Steinitz
Hi Dany, I'm not sure what's wrong but, for what its worth, I use: NSFont * aFont = [NSFont fontWithName: @"Cochin" size: 10.0]; aFont = [fontManager convertFont: aFont toHaveTrait: NSBoldFontMask]; Cheers, Steve On 14 Nov 11

Re: Core Data : Correct way to force reading property from sql store?

2012-01-15 Thread Steve Steinitz
Hi Jerry, On 16 Jan 12 Jerry Krinock wrote: > It seems like "gimme the latest value of object.foo from the disk" shouldn't > be so hard. It is indeed that hard, possibly for a good reason, but let's not go into that. You've correctly handled the staleness interval. You may also want to save

Sync Services for Multi-machine Core Data App?

2011-03-06 Thread Steve Steinitz
Hi, Our Core Data point-of-sale app currently shares a sqlite database on an NAS, each machine periodically fetching fresh data and, of course, saving. It works well and fast but is vulnerable to: network failure, Apple preventing it (as evidenced briefly in 10.6.2), sqlite mult

Core Data Intermittently Blocked Over AFP?

2011-03-08 Thread Steve Steinitz
Hello, Our Core Data App Runs on seven machines, five of them pretty active, all sharing a store on a Network drive over AFP. Previously I've accepted constructive criticism of that architecture and ideas on alternative architectures, but in this thread I'd like to focus on one particular an

Re: Core Data Intermittently Blocked Over AFP?

2011-03-08 Thread Steve Steinitz
Hi M, On 8/03/11, A.M. wrote: If that's true, then can you confirm this by switching to a different remote FS protocol (smb)? Good idea, thanks. Or does the file locking required for this unsupported design no longer properly function over other protocols? Yes, according to Ben and others

Re: Core Data Intermittently Blocked Over AFP? (Steve Steinitz)

2011-03-13 Thread Steve Steinitz
I wrote: The machines appear to become "blocked", i.e. fetches that usually take a few hundredths of a second begin take 15 to 40. It happens after another machine saves to the database. Only relaunching the App fixes it - until another machine saves. Increasing SQLite's cache_size solved th

Re: Exception not being caught

2011-03-21 Thread Steve Steinitz
nastiness failing, it would be handy to have a bullet-proof way to @catch any exception originating from a @try block - non-main thread, alternate universe or otherwise. Cheers, Steve Steinitz ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) P

Re: CoreData: "Could not fulfill a fault", but only sometimes?

2011-04-21 Thread Steve Steinitz
Hi Felix, On 21/04/11, Felix Franz wrote: I have a strange bug in my CoreData-Application (sql store). I received bug reports where the program throws an exception "Could not fulfill a fault". This happens while loading the document. I've been seeing that issue for a few years, but in a non

Re: Sync Services for Multi-machine Core Data App?

2011-04-23 Thread Steve Steinitz
(Apologies - I found this in my drafts folder - better late than never?) Hi Nick, On 7/03/11, Nick Zitzmann wrote: My question: is [using Sync Services for a large Core Data database] a good idea? No. Thanks for that clear answer. Sync Services scales poorly and works best with up to

Re: CoreData problem - AttributeDescription seems invalid --- What am I doing wrong?

2011-06-02 Thread Steve Steinitz
Hi Matti, On 2/06/11, Motti Shneor wrote: @interface NSManagedObject (OURExtension) @property (readonly) NSMutableDictionary *attributesAsDictionary; @end - (NSMutableDictionary *)attributesAsDictionary { NSMutableDictionary *attributesDictionary = [NSMutableDictionary dictionaryWithCapacit

Re: Calculations in a tableview

2011-07-28 Thread Steve Steinitz
Hi, On 29 Jul 11, at 10:51am, cocoa-dev-requ...@lists.apple.com wrote: > For example, lets say I have a tableview with 3 columns: quantity, unit price > and total. I want to calculate total using (quantity * unit price). Pretty > simple using a datasource but I've no idea how to do that with bi

Re: Binding and Observers

2009-12-08 Thread Steve Steinitz
Hi Gerriet, On 8/12/09, gerr...@mdenkmann.de wrote: MyDocument.nib has an IKImageView and an NSSlider with it's value bound to myIkView.rotationAngle. But when I closed the window I got an exception complaining about some observers not beeing removed. Is it the 'Cannot remove observer...' e

Re: Shared CoreData DataModel and DB file..

2009-12-28 Thread Steve Steinitz
Hi Bob, On 28/12/09, Robert Monaghan wrote: Is it possible to share a DataModel and resulting db file between 2 apps? If so, what sort of pitfalls are present? I want to create an App that creates the DB file, and a plugin for another App, that reads the database file. I have 5 machines sh

Core Data SQLite share hang on 10.6.2

2010-01-20 Thread Steve Steinitz
Hello, For the past few years we've been running a Core Data SQLite application on 5 machines, all accessing the database from a Synology network drive via afp. However, after upgrading to 10.6.2, only one machine can access the database at a time. Any number of machines still running 10.6.

Suppress or Fix Inverse Relationship Warnings

2010-02-24 Thread Steve Steinitz
Hello, After research and reflection I decided to remove some troublesome inverse relationships from the Core Data model in my multi-machine application. I've taken steps to avoid database integrity issues and have written accessors to preserve the data embodied in the removed relationships.

Re: Suppress or Fix Inverse Relationship Warnings (Mike Abdullah)

2010-02-28 Thread Steve Steinitz
Hi Mike, On 26/2/10, Mike Abdullah wrote: There's a section in the Build Settings entitled "Data Model Compiler (MOMC) Warnings". Should find everything you want there. Thank you. Really helpful. I've raised an enhancement request for an extra suppression option named, tentatively, "Suppre

Re: CoreData and ArrayControllers

2009-06-16 Thread Steve Steinitz
Hi Steve On 16/6/09, Steve Cronin wrote: A quick scan of your email leads me to think you've done everything correctly. Two questions: 1. are you sure the Window Controller's managedObjectContext exists? 2. what is the name (and maybe the description) of the exception? Cheers, Steve

Re: NSArrayController "Auto Rearrange Content" causes "Cannot remove an observer for key path" error

2009-06-25 Thread Steve Steinitz
Hi Tristan On 25/6/09, cocoa-dev-requ...@lists.apple.com wrote: Is there something I must do with CoreData to ensure KVO compliance when using auto rearrange content? I have a small project I've created to demonstrate this issue if anyone would care to take a look... I've moaned about thi

Re: NSArrayController "Auto Rearrange Content" causes "Cannot remove an observer for key path" error

2009-06-26 Thread Steve Steinitz
Hi Tristan, On 26/6/09, Tristan Celder wrote: The workaround I ended up using in the end was calling arrangeObjects manually and turning off auto arrange content completely. Not ideal, but it works... I think that may only reduce the frequency of the exception. I think I'm still getting the

Re: NSArrayController "Auto Rearrange Content" causes "Cannot remove an observer for key path" error

2009-06-26 Thread Steve Steinitz
Hi Tristan, On 26/6/09, Tristan Celder wrote: I've also filed a bug report 7010086 with example code attached. I have no idea if it actually submitted however (I tried twice) as it isn't appearing in 'my originated problems' and I am unable to search for it... hopefully we'll get a fix. Thank

Re: Core Data, NSArraycontrollers and secondary to-many relationships.

2009-07-21 Thread Steve Steinitz
array that you want, then bind to that. Hint 1, if you build a MutableSet you get (object-level) uniqueness for free. Hint 2, if your Model is in a state of flux, consider using mogenerator for overriding your Model classes. Cheers, Steve Steinitz ___

Re: Core Data Lightweight Migration Woes

2010-08-19 Thread Steve Steinitz
Hi Brad, After much struggle and even writing a nightmare migrator app, I discovered one day that the lightweight migration really does work. In broad brush strokes here's what I did: - Removed all the complicated migration support code that had never worked... - ...except the code that en

Re: Core Data Multiuser

2012-07-18 Thread Steve Steinitz
Hi Flavio, While Apple, SQLite, myself and any sensible software developer advise against it, Core Data can run multi-user by placing the database on a server which supports AFP (e.g. a fast Synology NAS over gigabit ethernet). SQLite has limited optimistic locking support, but the record locki

Dynamic Method Creation

2012-09-14 Thread Steve Steinitz
Hello, I'm writing a roster window for our point-of-sale app. I have some methods (on Employee) for binding to a view-based TableView (which looks a bit like a week planner), a set of methods for each day of the week. So far I have only implemented and debugged the Monday ones: - (Shift *)

Re: Dynamic Method Creation

2012-09-14 Thread Steve Steinitz
Hi Ken, Thanks for your quick reply. On 15 Sep 12, at 3:16pm, Ken Thomases wrote: > No offense, but this seems like a terrible design. And your KVO hack method > screams of papering over a bug. No offense but none of your criticisms seem to hold water. I might address them individually afte

Re: Dynamic Method Creation

2012-09-15 Thread Steve Steinitz
Hi Jean, On 15 Sep 12, at 6:12pm, Jean Suisse wrote: > There seem to be a pattern in you methods: they all contain the name of a day > of the week (monday) and you want them for all days. Yes, that was intentional, just for this purpose :) > Then you could use macros. > > Example : > > #defi

Re: Dynamic Method Creation

2012-09-15 Thread Steve Steinitz
Hi Kyle, Thanks for your reply. On 15 Sep 12, at 7:02pm, Kyle Sluder wrote: > A shift is an object with a known number of instances per employee. You've > those instances and splayed out thir properties as methods on the employee. Yes. I've "splayed" them because cocoa sometimes throws "canno

Re: Dynamic Method Creation

2012-09-15 Thread Steve Steinitz
Hi, Thanks to everyone for your, sometimes passionate, replies. I have decided not to further address your individual posits here, except to again thank Jean Suisse for providing a concrete example of using macros to generate binding methods. I would be delighted to pursue your interesting si

Core Data - nil-ing a relationship to a missing object

2012-09-25 Thread Steve Steinitz
Hi, If a Core Data to-one relationship is missing its target entity (and so throwing can't-fulfill-fault exceptions), how can I set the relationship to nil? If I do object.missingObject = nil; or [object setValue: nil forKey: @"missingObject"]; Core Data throws (when it tries

How to Delay, Wait, Pause...

2008-05-24 Thread Steve Steinitz
Hello, This is hard to google for because they are such common words: how do I delay, wait, pause for a tenth of a second? I don't want to use NSTimer because I just want to resume where I left off. I don't want to be in a tight loop because I need the system to finish something. I just wan

Re: How to Delay, Wait, Pause...

2008-05-25 Thread Steve Steinitz
Hello, Thank you Jens Alfke, Peter Burtis and Stephen Joseph Butler for your excellent, quick and helpful replies. Thank you Jens for the heads up about the threading and for letting me know that things are done this way in Cocoa -- I just didn't want to be out in left field. Below. for fu

Re: How to Delay, Wait, Pause...

2008-05-25 Thread Steve Steinitz
Hi Bob at [EMAIL PROTECTED] (Thomas Davie) On 25/5/08, Thomas Davie wrote: I hate to say this, but any form of delay here is the *wrong* way to do this. You already know you have a race condition, all you're doing is making it so the race condition will work out in your favor 99.99% of the tim

Re: How to Delay, Wait, Pause...

2008-05-25 Thread Steve Steinitz
Hi Ken, On 25/5/08, Ken Thomases wrote: Just for posterity, there's also the simpler, more efficient [NSThread sleepForTimeInterval:0.1]. The documentation says it's only available in 10.5 and later, but the 10.5 release notes say that it was always available but only recently published in the

Re: How to Delay, Wait, Pause...

2008-05-25 Thread Steve Steinitz
Hi Dimitri, Thanks for your insightful reply. On 25/5/08, Dmitri Goutnik wrote: Have to agree with Thomas that delay is the wrong way to handle this. Yes, he makes a good point. From 10.4 on fetch: results are delayed until the next iteration of the run loop so (please correct me if I'm wr

Re: How to Delay, Wait, Pause...

2008-05-25 Thread Steve Steinitz
Hi Jens, Thank you for your clarifications. I had been left with an unsettled feeling about the technique. On 25/5/08, Jens Alfke wrote: > On 25 May '08, at 2:40 AM, Thomas Davie wrote: > > >I hate to say this, but any form of delay here is the *wrong* > >way to do this. You already know yo

importing sqlite data into a core data "database"

2008-07-12 Thread Steve Steinitz
Hi John, On 12/7/08, [EMAIL PROTECTED] wrote: 1) a) generate my application in XCode, use the sqlite storage option, put in some dummy data, then use sqlite3 to explore the resulting schema, b) transform my data into the new schema using sqlite3 and sql. Replace the sqlite file created by my a

Re: Questions about Core Data and SQLite

2008-07-14 Thread Steve Steinitz
Hi, On 14/7/08, [EMAIL PROTECTED] wrote: On Jul 14, 2008, at 8:12 AM, Chris Hanson wrote: However, managing simultaneous access by *different users* to a SQLite persistent store is slightly trickier -- they must all access the persistent store in ways that have compatible file locking.

Re: Cocoa-dev Digest, Vol 5, Issue 1427

2008-08-10 Thread Steve Steinitz
Hi Graham, On 10/8/08, Graham Perks wrote: Now when I save my document I get a sheet saying, "This document's file has been changed by another application since you opened or saved it", and asking if I want to save or not. Eh? What's that all about? The document that's open post-migratio

Re: Core Data versioning woes

2008-08-10 Thread Steve Steinitz
Hi Graham, On 10/8/08, Graham Perks wrote: >>Now when I save my document I get a sheet saying, "This >>document's file has been changed by another application since >>you opened or saved it", and asking if I want to save or not. >>Eh? What's that all about? > >The document that's open post-

Re: Core Data versioning woes

2008-08-10 Thread Steve Steinitz
Hello Mr Crawford, Oops, didn't want to hijack Graham's nice clean thread. However... On 10/8/08, mmalc crawford wrote: ps. one special problem I have is that I don't want the migration to happen automatically because four users share the same database.

Re: Core Data merging

2008-08-14 Thread Steve Steinitz
Hello Vadim, For what its worth, I can't see obvious problems with your code. Myself and others have been stuck at the same, frustrating point. I gave up and resurrected my custom migration code based the samples included with Mac OS X 10.4. But its a pain to maintain and gives me a headac

Inter-machine notifications

2008-09-11 Thread Steve Steinitz
Hello, We have a Core Data app running on 5 computers. We've used a variety of kludges and nasty overkills to keep the data consistent on the shared sqlite database. Now, however, it appears that we will need some kind of notifications for critical inventory changes to the database. I imp

Re: Inter-machine notifications

2008-09-11 Thread Steve Steinitz
Hi Kirk, I wanted to thank you for your informative and helpful post. You've straightened out the client-server (or not) aspect for me and thanks for the pointer to the demo and the bit of history about the demo. Its all very interesting and I'm re-energized to try again. I'm still not clea

Re: Core data "grand-children" list

2008-09-16 Thread Steve Steinitz
Hi Toma On 16/9/08, Toma? Kragelj <[EMAIL PROTECTED]> wrote: I have the following core data model: Project <>> Session <>> Measurement On my form I want the user to select the desired project from the table and then based on that selection, I want to display all measurements (for

Re: Can core data save to a remote file?

2008-03-14 Thread Steve Steinitz
Kyle Sluder wrote: On 13/3/08, [EMAIL PROTECTED] wrote: Core Data does not support simultaneous access to a store. With a bit of fussing, tweaking, brute force and tears its working OK for me. Knock on wood. Four machines access (only two of them heavily) a little Thecus network disk stri

Cannot remove an observer

2008-03-20 Thread Steve Steinitz
Hello, I have what, in WebObjects, we used to call a master-slave display. I show a list of specific Products based on the selected Product Model, hereafter referred to as the 'Model'. So when a user picks a certain Model of sunglasses in the master list, she sees all the different size/colo

Master-Slave Display Exception - Cannot remove an observer

2008-03-27 Thread Steve Steinitz
Hello, I sent this just before the Easter break but didn't receive a reply. I thought I'd try again now that we're all back at work. I have what, in WebObjects, we used to call a master-slave display. I show a list of specific Products based on the selected Product Model, hereafter referre

Cannot remove an observer ... because it is not registered as an observer.

2008-05-04 Thread Steve Steinitz
Hello, I now have two projects where I am getting the error below. I've tried some obvious things like adding calls to will|did Access|Change ValueForKey to my custom methods and also ensuring key-value compliance by adding dummy setters. Here is the error. Cannot remove an observer for t

Re: Cannot remove an observer ... because it is not registered as an observer.

2008-05-06 Thread Steve Steinitz
Summary: KVO compliance discussion Detailed problem description Request (to Jens) for clarification What I've tried A failed workaround A crappy, unsound workaround Hi Jens, Jack and List Participants, Thanks, Jens, for your reply. On 4/5/08, Jens Alfke wrote: Cannot

Core Data - fresh data for text field not connected to array controller

2008-12-26 Thread Steve Steinitz
Hello, I'm using core data (sqlite) in a multi-user environment. With a little tweaking, each machine now has fresh data when it counts -- at least when I bind text fields (etc) to array controllers of managed objects -- the KVO seems to work almost by magic. However, I have one entity tha

Re: Core Data - fresh data for text field not connected to array controller

2008-12-26 Thread Steve Steinitz
Hi mmalc, Thanks for your reply. I've answered your questions below. On 26/12/08, mmalc Crawford wrote: However, I have one entity that has only one record (for user preferences). I fetch the record fresh into its very own managedObjectContext for each access -- and even resetting the mana

Re: Displaying multiple core data relationships in NSOutlineView

2009-01-16 Thread Steve Steinitz
Hi Rick, On 16/1/09, you wrote: The design I'm trying to achieve is analogous to the way Xcode displays a "Targets" group and a "Bookmarks" group in the same outline view. If Core Data was used for this (and I don't know if it was), it seems clear that Targets and Bookmarks would be mode

Formatting Core Data Conflict List

2009-01-28 Thread Steve Steinitz
Hello, I'm trying to track down the cause of hundreds of optimistic locking errors in a multi-user core data application. A clue might be found in the core data conflict list. However, its a format that I don't recognize and find difficult to read. Does anyone know a way to display it nice

Analyzing Core Data Conflict List [was: Formatting Core Data Conflict List]

2009-01-29 Thread Steve Steinitz
Hi Ben, Thanks for your helpful reply. On 29/1/09, Ben Trumbull wrote: It's just an array of dictionaries with a fixed set of keys. Ah, yes, I can see that now -- the familiar logging format. The newVersion and oldVersion shows the version count on the objects really has changed. OK, th

Re: Analyzing Core Data Conflict List

2009-01-30 Thread Steve Steinitz
Hi Ben, Thanks for your reply. I've made some comments and asked a couple questions. In particular please see the one (at the end) about prefetching in an NSArrayController scenario. On 30/1/09, Ben Trumbull wrote: While we strongly discourage using no inverse relationships, something lik

Re: CoreData relationship/KVC question

2009-01-30 Thread Steve Steinitz
Hi Jean-Nicolas I may not grasp your question but are relationship also KVC? You can do KVC stuff with relationships like employees = [department valueForKey: @"employees"]; but I doubt that's what you mean. and, will CoreData aumatically call the correct method depending on the type

Re: CoreData relationship/KVC question

2009-01-30 Thread Steve Steinitz
Hi Jean-Nicolas On 30/1/09, Jean-Nicolas Jolivet wrote: Using that accessor I know I can do the following: [aDepartment addEmployeesObject:anEmployee]; How would I do that using KVC ? [[aDepartment primitiveValueForKey: @"employees"] addObject: anEmployee]; might work. I think the

Re: Analyzing Core Data Conflict List

2009-02-03 Thread Steve Steinitz
Hi Ben, Oops, I omitted some key information in the previous message... We wrote: Here's what I added to awakeFromNib in my NSArrayController subclass: [request setRelationshipKeyPathsForPrefetching: [NSArray arrayWithObjects: @"customer", @"salesPerson", @"payments", @"lineItems", @"bikes",

Re: Observing Managed Object Changes

2009-02-26 Thread Steve Steinitz
Hi Jerry, I wanted to second your thanks to Ben for his sound advice and to thank you for raising your masterful enhancement request. It benefits all core data developers. Would you consider providing an ER-raising service? :) Those overworked Apple core data engineers wouldn't know what h

Re: CoreData: Fetching object with maximum of property

2008-10-07 Thread Steve Steinitz
Hi Frank, You wrote Hi Bill, I tried using predicates for this but did not succeed. What would a predicate look like which finds the object of an entity with the maximum value for a property? I haven't done exactly what you want but if you have an object that has a to many relationship to

refreshObject doesn't seem to work

2008-10-08 Thread Steve Steinitz
Hello, We use Core Data for a multi-user, multi-machine point-of-sale system in a bicycle shop. When someone sells a bike on one machine the other machines don't immediately see it. I've tried everything I can think of, short of resetting the managedObjectContext to refresh the bike and its

re: refreshObject doesn't seem to work

2008-10-08 Thread Steve Steinitz
Hi Ben, Thanks for your reply. I was hoping to hear from you. On 8/10/08, Ben Trumbull wrote: Core Data for a multi-user How is this configured ? Through distributed notifications replicating changes, or a network file system mount ? If the later, is it AFP ? We're not yet using distri

Solved: refreshObject doesn't seem to work

2008-10-09 Thread Steve Steinitz
Ben, Thanks for your consummate help. On 8/10/08, Ben Trumbull wrote: Okay, that should work, although due to table level locking SQLite really only handles a small work group, or a scenario that is primarily readers. On busy weekends we only have three machines operating - we leave the tw

Re: Cocoa-dev Digest, Vol 5, Issue 1813

2008-10-22 Thread Steve Steinitz
Hello Mr Bumgarner, On 22/10/08, Bill Bumgarner <[EMAIL PROTECTED]> wrote: (I did a little demo app at one point long ago that used an in memory store to cache results from Amazon's web services API. The front end was all pure Cocoa / bindings / CD with a minimal amount of additional cod

Xcode 3.1 (iphone SDK version) breaks my Core Data app

2008-11-07 Thread Steve Steinitz
Hello, I have a Core Data application that worked well when built from Xcode 3.0. I updated to the iphone SDK version of Xcode 3.1 and now the app no longer works. It won't open the production database but will open a small, testing database. When the app starts up it gives the following (n

Re: Xcode 3.1 (iphone SDK version) breaks my Core Data app

2008-11-07 Thread Steve Steinitz
Hi Rob Keniger, Joar and Nick Zitzmann, Thanks for your quick replies and thanks in advance to anyone else who replies. Rob and Joar you were right about Guard Malloc. Its running perfectly now. What a huge relief. I had visions of core data database format incompatibilities... Its probably w

Subject: Re: Core Data entity fetching by date

2008-11-09 Thread Steve Steinitz
Hi, Quincy gave such a masterful and complete answer that I felt compelled to also make a small contribution. If you decide to go the in-memory route, this simple routine may save you a few minutes of head scratching: - (BOOL) selectedRangeContainsDate: (NSDate *) date { NSComparisonRes

Re: Core Data search box: how to preserve selection while

2008-11-12 Thread Steve Steinitz
Hi Arthur, You wrote, When the user searches for some item, the selection in the table is not preserved, which causes the rest of the application to behave unexpectedly. How can I preserve this selection, and make the user select a new item explicitly also when using the search box? If you wa

Re: Core Data, Filtering by PopUps & Bindings Confusion

2008-11-14 Thread Steve Steinitz
Hi Brad, I couldn't grasp from a quick skim of your post whether types are related to categories in your model, ie. category <-->> type. If so, I'd say keep trying to do it with bindings -- it will work. If not, I had a similar scenario where I ended up creating a custom NSArrayController, to

Programatically Triggering an NSSearchField Search

2008-11-25 Thread Steve Steinitz
Hello, I use NSSearchFields bound to NSArrayControllers to allow my client to search their Core Data database. Pretty standard. My search predicate bindings are lengthy, giving my client lots of options to find what they want. Occasionally I would like to programmatically specify a search

Re: Programatically Triggering an NSSearchField Search

2008-11-26 Thread Steve Steinitz
Hi Frédéric Thank you for your helpful reply. On 26/11/08, Frédéric Testuz wrote: I'm not sure but did you try : [searchfield validateEditing]; - (void)validateEditing Thank you so much for pointing me to NSControl. I found many goodies there. validateEditing on its own did not solve th

Re: Programatically Triggering an NSSearchField Search

2008-11-26 Thread Steve Steinitz
Hi Frédéric I determined that a single method will propagate a programatically-set NSSearchFieldCell value to its NSArrayController: [searchfield setStringValue: aSearchString]; [searchfield performClick: self]; Ta-Dum. Thanks again Frédéric and all the best, Steve ___

Re: core data, refreshObject, multiple threads

2008-12-05 Thread Steve Steinitz
Hi Chris, On 5/12/08, Chris Idou <[EMAIL PROTECTED]> wrote: I've got a main thread that handles a gui, and a worker thread with its own persistentStoreCoordinator and managedObjectContext. The gui notifies the worker thread of a change, passing it an objectID, and the worker thread gets the

Re: Distributed objects and core data

2008-12-05 Thread Steve Steinitz
Hi Jason, On 5/12/08, Jason Cox <[EMAIL PROTECTED]> wrote: Is it possible to use distributed objects with core data on a server app to get a multi client application working? I've gathered together a set of DO sample apps toward a similar idea. My plan is for the machines to share a core d

Re: core data, refreshObject, multiple threads

2008-12-07 Thread Steve Steinitz
Hi Chris, On 7/12/08, Chris Idou wrote: I've even tried [managedObjectContext reset] and querying from the beginning, but that doesn't seem to work either. My experience has been that that works (at least in 10.5 with GC activated). I'm no Cocaa memory management expert but I suppose there

Re: Newbie: Learning path for my GTD app...

2009-03-04 Thread Steve Steinitz
Hi Biagio On 4/3/09, cocoa-dev-requ...@lists.apple.com wrote: would just like some guidance as to where to focus my attention after I get through the above books. Any thoughts would be much appreciated. Core Data is a wonderful, powerful technology that, to a certain extent, makes persisten

Re: CoreData and NSObjectController

2009-03-09 Thread Steve Steinitz
Hi Michael, On 9/3/09, michael.suess...@utanet.at wrote: When I execute the program and click on the add button, the controller creates a new data record and I can enter the attributes. If I press again the button, the add method is called, but no new record is created. I've had plenty o

Re: Bug+Fix: NSController (and subclasses) have problems with custom KVO keys

2009-03-20 Thread Steve Steinitz
Hi Marc and Quincy On 19/3/09, m...@sky4studios.be wrote: 'NSInternalInconsistencyException', reason: 'Cannot remove an observer for the key path "targetPhoto.name" from , most likely because the value for the key "targetPhoto" has changed without an appropriate KVO notification being sent. Ch

refreshObject throws for object no longer in database

2009-05-17 Thread Steve Steinitz
Hello, I'm using Core Data for a multi-user point-of-sale system. To overcome occasional exceptions on save, I've added code to refresh objects from the database store (using a sort of souped up [context refreshObject:]) periodically during idle and, if needed, just before key operations lik

  1   2   >