How do I get data out of NSRuleEditor?

2016-06-26 Thread Jim Thomason
I've been desperately trying to use NSRuleEditor for a while now, since it presents exactly the type of interface I want to show to the users. But I can't figure out how to properly get data out of it. I can configure all of the delegate methods to build the interface, but then what? The data I'm

Re: Two Array Controllers, loading from CoreData, without a contentArray...

2015-09-22 Thread Jim Thomason
h entities to fetch and with what predicate. I think I'd rather post the notification to the other array controller to keep it all loosely coupled, if I had to choose between the two techniques. -Jim... On Tue, Sep 22, 2015 at 5:28 PM, Richard Charles wrote: > > > On Sep 2

Re: Two Array Controllers, loading from CoreData, without a contentArray...

2015-09-22 Thread Jim Thomason
> Array Controllers etc. can be configured to monitor their context for changes and automatically re-fetch when needed. So they should keep in sync that way without any extra work. > It can? How? I'm only aware of the prepares content flag, but that'll only load the data into the controller when

Two Array Controllers, loading from CoreData, without a contentArray...

2015-09-22 Thread Jim Thomason
First, to be clear, I'm not actually trying to do this. I'm just curious how it could be done. I cooked it up while working on other things. The question is simple - is there a reasonable way to create two NSArrayControllers, have them bound to an entity through CoreData, and keep them in sync? S

Should all CoreData relationships be optional in swift?

2015-09-15 Thread Jim Thomason
I'm doing some porting/updating work and came across an issue. I have two objects - which we'll call Foo and FooType. Every Foo must have a FooType, and every FooType is associated with multiple Foos. The FooType also has an image associated with it, and the Foo uses that image exclusively. So

View based table binding to alternate object?

2015-08-11 Thread Jim Thomason
This example is a little contrived, because I'm struggling with how to phrase it properly. The answer to the question might be as simple as "You can't do that,", and I'm cool if it is, I just want to confirm I'm not doing something stupid. I have an array controller of mutable dictionaries. It has

Validating against multiple updated Coredata objects

2014-10-15 Thread Jim Thomason
Hi, In my user interface, I can have the user edit a field on an object, and behind the scenes this will trigger a cascade of other changes to other objects. As a result, I don't just need to validate the value the user typed in, I also need to validate all of the other changes that that single ed

Re: Good way to have default relationship to override nil?

2014-08-21 Thread Jim Thomason
Nope. The inverse is proxyFor. proxy points one way, proxyFor is the reciprocal. I'll see if I can boil it down to a small test case and post that. -Jim... On Wed, Aug 20, 2014 at 11:47 PM, Jerry Krinock wrote: > I understand the typos, Jim. > > So, what is the Inverse Relationship of the ‘pr

Re: Good way to have default relationship to override nil?

2014-08-20 Thread Jim Thomason
> > > I have a set of relationships: > > > > Foo.proxy <> Foo.proxyFor > > That’s a head-scratcher, Jim. A relationship is not between properties. > A relationship is between objects, > > Foo <——> Bar > > In some cases, probably yours, the objects may be of the same type… > > Foo <—> Foo > I

Good way to have default relationship to override nil?

2014-08-20 Thread Jim Thomason
I have a set of relationships: Foo.proxy <> Foo.proxyFor 1-1 mapping. The way that the data is structured, a Foo object may be a proxy for another one. However, the proxy is not required, in which case the original Foo object should be returned. I'd tried to set this up by creating a custom

NSRuleEditor help?

2013-01-15 Thread Jim Thomason
Is there a good tutorial or set of examples out there for NSRuleEditor? I'm quite interested in using the class, but the lack of documentation is definitely a hindrance. I found a couple of light examples that I'm trying to work through and reverse engineer the rest of the functionality, but it's s

Re: Service with NSURLConnection

2013-01-11 Thread Jim Thomason
nice simple example use case to give. For the actual code, I wouldn't be able to just do a synchronous request. -Jim On Fri, Jan 11, 2013 at 12:52 PM, Jens Alfke wrote: > > On Jan 11, 2013, at 8:59 AM, Jim Thomason wrote: > > The issue is that my -doWebStuff:userData:error

Re: Service with NSURLConnection

2013-01-11 Thread Jim Thomason
GCD block or use > some of the great open source libs out that kind people have already put > together to handle async net communication. > > > On Jan 11, 2013, at 11:59 AM, Jim Thomason wrote: > > > Gang, > > > > In my fighting with services, I'm trying a

Service with NSURLConnection

2013-01-11 Thread Jim Thomason
Gang, In my fighting with services, I'm trying a different approach and hence have a different question - is there a way that I could craft a service that reads in selected text, uses that to open and perform a web connection, and then returns that data back to the calling app? The trivially sill

help trouble shooting...maybe with resume?

2011-08-23 Thread Jim Thomason
Gang, Unfortunately, this is a very vague question but I'm at a bit of a loss and hoping someone could provide some general technique or avenues to explore. Apple recently rejected a new app of mine, with this explanation: When saving a file, and reopening it by double-clicking the saved file in

Re: Multithreaded Coredata save in Lion

2011-08-01 Thread Jim Thomason
> -saveDocument: has never been expected to do its work immediately. Instead, > you want to call: > > -saveDocumentWithDelegate:didSaveSelector:contextInfo: > > Then, when the delegate is called, spawn off your new MOC. That's exactly what I needed. A little rewiring of the app to use the delegat

Multithreaded Coredata save in Lion

2011-07-31 Thread Jim Thomason
Gang, I've encountered an odd bug/issue/feature(?) in Lion and want to know if there's a workaround available. I have a multithreaded CoreData application. It does a lot of calculations on the context, so it spawns off a separate thread and creates a new ManagedObjectContext to do its work. AFAIK

Re: How to extract files from zip archive?

2011-05-30 Thread Jim Thomason
On Mon, May 30, 2011 at 10:45 AM, Vyacheslav Karamov wrote: > Hi All! > ... >   [task setLaunchPath:@"/usr/bin/unzip"]; >   NSArray * args = [NSArray arrayWithObjects:@"-a ", listsPath, @" -d ", > sharedPath, nil]; In addition to what others have said regarding spaces and such, when I was looking

Re: how can I copy from another app?

2011-05-05 Thread Jim Thomason
add a toggle to turn off the functionality if the user has a non-qwerty keyboard, at least for now. Presumably, I can have them explicitly map the keys or otherwise divine them myself, but man what a nuisance. Implement any of this at your own risk, and be sure to understand the consequences of do

Re: how can I copy from another app?

2011-05-04 Thread Jim Thomason
> and without knowing what others have said, I can surmise that their replies > where no less perplexed with the question "but Why?" This gloriously ugly hack isn't the correct "why" question - the correct "why" question is "why do I even need to do it?" I want to be able to copy the current sele

how can I copy from another app?

2011-05-04 Thread Jim Thomason
I know this has been asked a bajillion times before, yet here we are. So it turns out that my simple little applescript to copy in from another app was ineffective. Lots more digging around led me to create this: tell application "Xcode" activate tell application "System Events"

Request for beta testers/feedback for programmer utility [please reply off-list]

2011-05-04 Thread Jim Thomason
All, I've written a small-ish mostly background clipboard/macro type utility and was wondering if anyone would be interested in helping me beta test/provide feedback. It's simply a way to store and insert frequently used snippets of text in a very fast manner. I wanted something to pop in, give m

Service with optional input

2011-04-30 Thread Jim Thomason
I've been working on implementing a new service in my app. It's coming along, but there's one thing I haven't been able to discern in the docs - Can I provide a service with optional input? I want the user to be able to call the service with a text string input, but it's also reasonable to call i

registerUndoWithTarget:selector:object: in or outside of group?

2011-02-24 Thread Jim Thomason
This is a braindead simple question, but I couldn't find a definitive reference. Is it better to register an undo action inside or outside of a group? i.e., is this preferred: [someUndoManager beginUndoGrouping]; //do interesting things //end group first [someUndoManager endUndoGrouping]; //the

CoreData migration opens ~ file by mistake

2011-02-22 Thread Jim Thomason
I'm finally trying to do my first CoreData migration using the "new" style 10.5 built-in migration tools. I'd abandoned my ad-hoc Tiger one a while back and finally needed to migrate. I'm building on Snow Leopard, and bugs and glitches aside (such as the workaround for migration for Leopard deploy

Re: NSCalendar dateByAddingComponents: yields inconsistent results

2011-02-19 Thread Jim Thomason
> Is this method called from different threads? NSCalendar is > thread-unsafe (not to be shared across threads): Gaaah. Yes, that's exactly it. I'm glad I tracked the issues with gmtCalendar and posted the method. I re-wrote it to use the threadDictionary instead of a static and all my problems m

NSCalendar dateByAddingComponents: yields inconsistent results

2011-02-19 Thread Jim Thomason
I'm utterly stumped. I haven't managed to boil this down to a succinct test case yet. It only intermittently appears, basically, after I end up doing a "lot" of date calculations on a separate thread. For some nebulous value of a "lot". The gyst is this - on occasion, NSCalendar's dateByAddingCom

Re: Crash in NSPersistentDocument writeToURL:ofType:forSaveOperation:originalContentsURL:error:

2011-01-27 Thread Jim Thomason
> Well, no. 'error' is an OUTPUT ONLY pointer. Specifically, on entry: > > 1. 'error' is either NULL (no error information should be returned), or a > valid address to return a NSError* into, if an error occurs > 2. '*error' is trash (<-- subtle, but important) > > On output: > > 1. If 'error' was

Crash in NSPersistentDocument writeToURL:ofType:forSaveOperation:originalContentsURL:error:

2011-01-26 Thread Jim Thomason
This is an extremely odd bug I just encountered, and it appears to be in NSPersistentDocument. Here's the deal - my coredata app implements writeToURL:ofType:forSaveOperation:originalContentsURL:error: so I can do some final sanity checks on my data before saving. If the checks succeed, we bubble

Re: Any way for a managed object to get at its document object?

2010-10-07 Thread Jim Thomason
On Thu, Oct 7, 2010 at 5:14 PM, Rick Mann wrote: > I have an NSPersistentDocument-based app. I need to implement a "setNeedsFoo" > method on the managed object that causes the receiver to be placed into an > NSMutableSet on the document, for later "foo" processing. As part of being > added to t

Tracking Area resets to view's bounds

2010-09-28 Thread Jim Thomason
I'm utterly confused by what I thought would be something simple. I have a custom view that I want to establish a few tracking areas for. So I go and create several NSTrackingAreas and add them to the view. All looks well. But later on, when my mouse events fire off, they're associated with the EN

What's the point of @properties?

2010-09-19 Thread Jim Thomason
I'm refactoring and updating a lot of my older code, and one of the things I'm finally looking into is declaring things as properties. But...what's the point? I've been trying to read up on the subject and have found a lot of posts and discussion about the subject, but very little of it seems to g

How to properly handle Undo and triggered actions

2010-03-14 Thread Jim Thomason
I have a coredata document based application, and lately I've been working on improving undo support. It usually works pretty well, but there have been some isolated issues that were problematic. After a lot of investigating over the past few days, I've finally isolated something and I think I kno

Re: Migrating changed objects between contexts

2009-12-02 Thread Jim Thomason
> It shouldn't deadlock. The doc for -lock says: "If you lock (or successfully > tryLock) a managed object context, the thread in which the lock call is made > must have a retain until it invokes unlock. If you do not properly retain a > context in a multi-threaded environment, this will result

Migrating changed objects between contexts

2009-12-01 Thread Jim Thomason
I'm stumped and hoping that there's some easy solution that I just haven't dug up yet. Yes, this is another coredata multithreading question. Anyway, in my application the user types in data and fills out forms and such. It's all tied into CoreData via bindings. Nothing exciting. But - I've also g

Re: CoreData could not fulfill a fault after Save As

2009-10-14 Thread Jim Thomason
On Wed, Oct 14, 2009 at 2:25 PM, Ben Trumbull wrote: >> The short description is this - I have a document based CoreData app. >> I can carefully craft a set of data. I then open the document, select >> a particular record, and do a Save As. This works fine. But when I >> select a second record, I

CoreData could not fulfill a fault after Save As

2009-10-14 Thread Jim Thomason
I'm completely and utterly stumped. I've stumbled across a showstopper bug and could use some pointers to try and debug it. Unfortuately, I haven't been able to reduce it into a succinct demo app. So clearly, the error is elsewhere in my code, but I can't figure out how to track it down yet. The s

Re: grouping undo across method calls in CoreData [with possible solutions]

2009-10-06 Thread Jim Thomason
Figured I'd address all the comments inline in one batch, and then point out what I came up with. An almost viable solution is up top for reference purposes, and a seemingly better one is towards the bottom. >Hm, do operations using primitive accessors also get registered on the undo >stack? If n

grouping undo across method calls in CoreData

2009-10-05 Thread Jim Thomason
I've got a CoreData document based application, and I'm trying to undo my object creation in a single step. Here's the issue - I'm storing an ordered index on my entities so I can keep track of the order of creation. To do this, upon object creation, I yank out the highest order parameter for my e

proper technique for CoreData SQLite fetch with sort descriptors

2009-09-25 Thread Jim Thomason
First off, I'll say that I'm trying to maintain Tiger compatibility in my app, so if anyone tries to duplicate this on Leopard or Snow Leopard, they may not have any luck. I have an NSArrayController bound to a set of objects in an SQLite CoreData store. The NSArrayController by default has severa

Re: Securely limit the running an application by serial number

2009-07-03 Thread Jim Thomason
>> I'm writing a 64-bit only app. Any pointers on where I can find info on >> obfuscation? > > > In addition to that, don't even think about doing your checks in objective-C. It's just too easy to hack around, and if somebody's dedicated to cracking you, i

Forcing NSTreeController to re-sort, and select inserted

2009-05-22 Thread Jim Thomason
I've been fighting with NSTreeController for a couple of days now and have gotten nowhere. I have a hierarchy of disparate objects. It's pretty simple - Class A has many Class B. That's it. I'd like to display it in an OutlineView. I don't care about adding in additional Class A (Parent) objects,

Changing CoreData store type

2009-04-29 Thread Jim Thomason
Howdy all, Hopefully this is a ridiculously simple question with a ridiculously simple answer, but I just haven't been able to find it. I have a document based CoreData app and I want to change the store type of the file. So it previously saved as XML, and I now want those docs to save as SQLite.

CoreData delete clean up

2009-04-24 Thread Jim Thomason
I just can't find a solution for this. Basically, I need a pre-delete hook in CoreData but can't seem to find one. Here's the deal - I have a Foo object which has many Bar objects. Foo also has a property that's calculated off of the various values in Bar. So Bar has many custom set methods that

Re: Report writer for Cocoa?

2009-01-14 Thread Jim Thomason
A lot of people tend to link in webkit and layout a printed report using html and css. It's somewhat eqasier than standard web dev since you know that only webkit will be displaying your layout. No need for cross browser compatability. I use that aqpproach for one of my apps and it works well enou

Bindings alert issue

2008-11-11 Thread Jim Thomason
Here's a peculiar little case that I hope is easy to resolve. Here's the case I ran into: I had bound an NSTextField to an attribute of an object. The interface at that point implied that the user could update the value in that field, then immediately click a button to perform an action. The prob

NSCalendarDate has subsecond precision

2008-08-15 Thread Jim Thomason
Wow. I just spent about an hour and a half debugging this, since it's rather nefarious. Now I need to go back to all sorts of existing data and correct for it, too. :-( Anyway, I'm just posting to the list as an informational thing just in case anybody else runs into a similar issue. I wasn't havi