NSDirectoryEnumerator and URLs

2010-01-13 Thread Jamie Hardt
Hello all, I'm using a directory enumerator to recurse through a series of directories, and it always fails after going through a certain number of enumerations. If I enumerate through the same directory over and over, it tends to fail in about the same place, but if I enumerate through other

Re: NSDirectoryEnumerator and URLs (PS)

2010-01-13 Thread Jamie Hardt
On Jan 13, 2010, at 11:38 AM, Robert Martin wrote: > PS - Also, when I use NSDirectoryEnumerator, it returns a string, not an > URL... The documentation actually doesn't say... I assumed that a directory enumerator that is created with a URL would return URLs, but I guess not... In any case,

Re: NSDirectoryEnumerator and URLs (PS) [resolved]

2010-01-13 Thread Jamie Hardt
Yeah that works, I had an assertion failing in there somewhere… Now I have to go pester the sqlite-users list. Yick. Jamie On Jan 13, 2010, at 1:38 PM, Robert Martin wrote: > Assuming that the original path is valid, this looks ok to me - maybe you > might try commenting out the lines: > >>

Cancelable NSBlockOperations

2010-01-14 Thread Jamie Hardt
A quick question... How does one support -cancel in an NSBlockOperation? Testing [NSThread isCancelled] doesn't appear to work. Jamie___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to t

Re: Cancelable NSBlockOperations

2010-01-14 Thread Jamie Hardt
On Jan 14, 2010, at 11:59 AM, Nick Zitzmann wrote: > On Jan 14, 2010, at 12:30 PM, Jamie Hardt wrote: > >> How does one support -cancel in an NSBlockOperation? Testing [NSThread >> isCancelled] doesn't appear to work. > > The same way you do it with NSInvoc

Re: Cancelable NSBlockOperations

2010-01-14 Thread Jamie Hardt
On Jan 14, 2010, at 12:07 PM, Nick Zitzmann wrote: > Sorry, forgot that block operations, unlike invocation operations, don't take > arguments. (Guess which one I use more often?) Yes, I'd try what you're > proposing. It was a good though, but doing something like this... NSBlockOperation *b =

Responding to kill signals with the run loop

2010-03-03 Thread Jamie Hardt
Is there a straightforward way, or a way through the Cocoa API, to treat signals like SIGTERM and SIGHUP as run loop sources and to handle them as events in the run loop? Right now I install signal handlers during initialization and these just set flags that are tested on every spin thru the r

Re: Responding to kill signals with the run loop

2010-03-03 Thread Jamie Hardt
Thanks! On Mar 3, 2010, at 7:28 PM, Ken Ferry wrote: > In 10.6 you can also do this by setting a dispatch queue on which you want a > block invoked when a signal comes in. If you give it the main dispatch > queue, that's like installing on the runloop of the main thread. > > See . > > This

Unit Testing and Run Loops

2009-07-04 Thread Jamie Hardt
Hello all, I've looked around for writing about this, but I can't really find anybody who has declared the absolutely right solution to this problem. I'm using the SenTesting kit and writing a class that initiates a web download, async using the run loop. How can I write a unit test that

Fwd: Unit Testing and Run Loops

2009-07-04 Thread Jamie Hardt
Thanks, I dimly recall seeing something like this before... On Jul 4, 2009, at 12:19 PM, A.M. wrote: On Jul 4, 2009, at 3:10 PM, Jamie Hardt wrote: [...] But does anyone know how to setup something like a stream read or URL download, and make sure run loop completely services the

NSArrayController fetchPredicate behaving badly

2008-09-11 Thread Jamie Hardt
right? I can't help thinking there's something goofy going on in my NSManagedObjectContext, something not being committed or updated or something. On a side note, does anyone know why I can't see the fetchPredicate for an NSArrayController in the debugger? No such member seem

Re: creating new instance of coredata entity

2008-09-11 Thread Jamie Hardt
How does the sqlite file relate to pulling XML from your website? I do not follow you there. On Sep 11, 2008, at 1:44 AM, Amy Heavey wrote: Hi, Sorry for the newbie question, I'm trying to write an app to access/edit data held in an sqlite file generated by another coredata app. I need t

Re: NSMutableArray, NSMutableDictionary memory managment

2008-09-11 Thread Jamie Hardt
All of the collection classes -retain and -release objects that are added to them, so you can release them in your code and as long as you are retaining or otherwise holding onto the collection itself, the collection will keep a strong ref to the objects it holds. http://developer.apple.com

Re: creating new instance of coredata entity

2008-09-11 Thread Jamie Hardt
Ah I see. XML on web -> your program -> sqlite store that someone else's program reads/writes. Looping over the data in the table should just be a matter of going through all of the items in the table's bound NSArrayController: //code NSArray *objectsToLoopThru = [myArrayControllerWithReco

Re: NSMutableArray, NSMutableDictionary memory managment

2008-09-11 Thread Jamie Hardt
ntext. I've been bitten by this before. On Sep 11, 2008, at 10:32 AM, infinite labs wrote: On Thu, Sep 11, 2008 at 7:18 PM, Jamie Hardt <[EMAIL PROTECTED]> wrote: "Arrays maintain strong references to their contents—in a managed memory environment, each object receives a reta

Re: creating new instance of coredata entity

2008-09-11 Thread Jamie Hardt
Oh... Is this what you mean? NSArray *objectsToLoopThru = [myArrayControllerWithRecordsFromTheWeb arrangedObjects]; foreach (id oneObjectInTable in objectsToLoopThru) { NSManagedObject *newObjectToStore = [NSEntityDescription insertNewObjectForEntityForName:@"

Re: NSArrayController fetchPredicate behaving badly

2008-09-11 Thread Jamie Hardt
rder it to fetch: or fetchWithRequest: UNTIL I save the document, at which time the array controller realizes what's been going on and fetches the correct scenes. IIRC, this is expected behavior. Quirky, perhaps. What you probably want is to apply the predicate also as a filter predicate. O

Re: Link aganist

2008-09-11 Thread Jamie Hardt
Did you include /usr/lib/libSystem.dylib into your Linked Frameworks? On Thu, Sep 11, 2008 at 3:04 PM, dexter morgan <[EMAIL PROTECTED]>wrote: > Hello List, > I've a simple c project that uses semaphores. > I've tried to include it inside the main.c > > #include > #include > #include > #includ

Re: Two Dimensional Array

2008-09-12 Thread Jamie Hardt
2 ways- * Identically to C: int myArray[X_SIZE][Y_SIZE]; This will perform much faster but will have all of the drawbacks of a dumb C array. * Or with NSArray/NSMutableArray: NSMutableArray *myArray = [NSMutableArray arrayWithObjects: [NSMutableArray array],[NSMutableArray array],nil]; e

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Jamie Hardt
the MainWindowController to do the view switching. All roads in the responder chain lead to the NSDocument eventually. Jamie Hardt The Sound Department http://www.soundepartment.com/ http://www.imdb.com/name/nm0362504/ ___ Cocoa-dev mailing list (Coco

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Jamie Hardt
can then call a method on controller A. This can work just as well. In your document class, after you've made the window controllers with -makeWindowControllers, hand them both a weak ref to the other, and then use methods on one to pass thru actions to the other. Jamie Hardt The Sound

Re: App name from Bundle Identifier?

2008-09-12 Thread Jamie Hardt
Dave- Just a thought NSString *path = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:bundleIdentifier]; NSString *appName = [[path lastPathComponent] stringByDeletingPathExtension]; On Sep 12, 2008, at 2:06 PM, Dave DeLong wrote: Hi everyone, I've been looki

Re: when should my NSWindowController be released?

2008-09-12 Thread Jamie Hardt
method is never called, even when the main app quits. In fact, the -dealloc method in the main controller is never called either. (I did not work on the main controller code.) Jamie Hardt The Sound Department http://www.soundepartment.com/ http://ww

Re: Core Data, Bindings, NSSearchField, and NSPopUpButton

2008-09-12 Thread Jamie Hardt
"[EMAIL PROTECTED]". That gives you a list of countries to populate the NSArrayController for Countries, and then you make the popup button's selection bound to a filter predicate on your Locations array controller. Jamie Hardt The Sound Department http://www

Re: Core Data and ordered relationships

2008-09-15 Thread Jamie Hardt
always "Manager," 2 was always "Shift Supervisor," etc. But even then I'd avoid locking myself down to a fixed number of roles per department, since these can change with reorganizations. Jamie Hardt The Sound Department

Re: NSApplication subclass crashes on 10.3 with Xcode 3

2008-09-17 Thread Jamie Hardt
Hello- I don't thin you can call dictionaryWithObject: without having an autorelease pool set up, and initialize might be getting called before autorelease pool for the main loop is getting setup. Try replacing dictionaryWithObject: with a standard alloc-init sequence. Or, do the initial

Re: NSApplication subclass crashes on 10.3 with Xcode 3

2008-09-17 Thread Jamie Hardt
You wont, since the garbage collector will be doing the work of the autorelease pool, and the log will just show references to a deallocated object as a bad access. Try running it in 10.3 with zombies enabled to get a warning that might be more useful. On Sep 17, 2008, at 10:06 AM, Kevin

Re: Core Data adding new instance - creating relationship to existing instance

2008-09-19 Thread Jamie Hardt
Hi- Your fetch request isn't finding any Categories, and the array returning from executeFetchRequest is empty. Before doing the setValue:forKey:, you should test the returned array from executeFetchRequest to make sure it contains >0 categories, and handle the situation appropriately if

Re: Using aggregate functions in a Core Data Fetch Request

2008-09-26 Thread Jamie Hardt
What about taking your objects and sorting them by value, and popping the last object? NSFetchPredicate *fr = /* lets say this is setEntity to your entity */; NSManagedObjectContext *moc = /* your moc here */; [fr setSortDescriptor: [[[NSSortDescriptor alloc] initWithKey:@"value" ascending:Y

Re: Need to override +(Class) class?

2008-09-27 Thread Jamie Hardt
CosMouseViewController.o My question is, do I need to override the +(Class) class method for each InputElement subclass, and if so how do I make a Class object? Jamie Hardt The Sound Department http://www.soundepartment.com/ http://www.imdb.com/name/nm0362504/ _

Re: WebView security level?

2008-10-02 Thread Jamie Hardt
WebViews don't have a "security level" in the sense of IE; if the client (your app) wishes to apply certain security measures, it can do so by using setting the WebPreferences object of the web view to allow/ disallow javascript, java, allow/disallow plugins (all or nothing), and the client

Re: silly event question 'cuz i'm a n00b

2008-10-08 Thread Jamie Hardt
here as a result of a GUI action. How do I do this in Cocoa, or is there a better way? Jamie Hardt The Sound Department http://www.soundepartment.com/ http://www.imdb.com/name/nm0362504/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please d

Re: Views, frames, and bounds

2008-10-18 Thread Jamie Hardt
e view. SO, if you took the hypothetical view "B" above and stroked from (0,0) to (100,0), the line would only go halfway across the view (50 pixels), as its bounds.size.width are 2x of its frame.size.width. Hope this helps. Post your code, as you might have the rects all r

Re: Path handling routines

2008-10-29 Thread Jamie Hardt
On Oct 29, 2008, at 6:01 AM, Daniel Luis dos Santos wrote: Hello, Are there in the Foundation framework (or anywhere else on the Cocoa platform) path handling routines (directory extraction, path decomposition) ? NSString has several methods for extracting the basename, directory name

Re: How do I call a function when my preference pane bundle closes?

2008-10-29 Thread Jamie Hardt
cation, NSUserDefaults and its friends are definitely the simpler way to go, but they both work. Jamie Hardt The Sound Department http://www.soundepartment.com/ http://www.imdb.com/name/nm0362504/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.

Facile Core Data Question

2008-11-22 Thread Jamie Hardt
ave a godlike object listening for the "NSManagedObjectContextObjectsDidChangeNotification" and doing the action upon the object's removal. I don't think I'm doing this exactly the right way, and I'd like to know if anyone else does this differently? Ja

Re: Facile Core Data Question

2008-11-22 Thread Jamie Hardt
Maybe a poor choice of words on my part. s/God Object/Any old model object/ Just with the understanding that this object not be a controller. On Nov 22, 2008, at 7:07 PM, Kyle Sluder wrote: I don't see why this requires a god object; why can't your model-controller (NSPersistentDocument sub