Catching double click in Cocoa OSX
NSResponder seems to have no mouse double click event. Is there an easy way to catch a double click? ...
NSResponder seems to have no mouse double click event. Is there an easy way to catch a double click? ...
What I am searching for is a Cocoa (or third party) class that can display time intervals in natural language, e.g.: 10 seconds ago 1 hour ago 2 days ago Do you know anything that could help me to achieve this task without writing it by myself and melting in if-else hell? ...
NSInvocation seems to be one of the worst designed functions in Cocoa, so I decided to check if anyone had written a recipe to make using it easier. I found a recipe on Matt Gallagher's blog. Now to be able to do this he used some quite hackish techniques. Would you recommend using this code or is this technique too likely to lead to a...
How can I scale the content of a WebView? ...
What are some of the obscure pitfalls of using Core Data and threads? I've read much of the documentation, and so far I've come across the following either in the docs or through painful experience: Use a new NSManagedObjectContext for each thread, but a single NSPersistentStoreCoordinator is enough for the whole app. Before sending an...
I have a Message entity that has a messageID property. I'd like to ensure that there's only ever one instance of a Message entity with a given messageID. In SQL, I'd just add a unique constraint to the messageID column, but I don't know how to do this with Core Data. I don't believe it can be done in the data model itself, so how do you ...
I have an application that I have been developing for some time now. Recently launching the application via a double click presents a dialog that says "You can't open the application RepoWatch because it may be damaged or incomplete." Launching the application via open ./RepoWatch.app gives me "The application cannot be opened because i...
I'm using an OpenPanel to get a file path URL. This works: [oPanel beginSheetModalForWindow:theWindow completionHandler:^(NSInteger returnCode) { NSURL *pathToFile = nil; if (returnCode == NSOKButton) pathToFile = [[oPanel URLs] objectAtIndex:0]; }]; This doesn't, resulting in an 'assignment of read-only variable' error: NSUR...
How do I save an NSString as a .txt file on my apps local documents directory (UTF-8)? ...
I have a ContactsViewController which -whenever a row is selected- MessageViewController is opened (using pushViewController). Both the ContactsViewController and the MessageViewController 'register' to receive DatastoreDelegate messages. The weird thing is it all works fine upon loading of my application, but once I navigate to the Mess...
I have a Core Data iPhone app that displays Subscription entities where any of its items are not read. In other words, I construct a predicate like this: [NSPredicate predicateWithFormat:@"ANY items.read == NO"] While this works for the initial fetch, it doesn't affect Subscription entities when I modify an Item, so the NSFetchedResul...
Hi, Are there any frameworks that capture and report exceptions? I need something that catches any exceptions or errors caused by my program while its being used by a non-technical user and then to email it to me. Do you handle this on your own projects? Did you roll your own solution or is there an off the shelf solution? Any help wou...
I'm having problems starting & stopping NSTimers. The docs say that a timer is stopped by [timer invalidate]; I have a timer object declared as such .h NSTimer *incrementTimer; @property (nonatomic, retain) NSTimer *incrementTimer; .m @synthesize incrementTimer; -(void)dealloc { [incrementTimer release]; [super dealloc]; } -The u...
I've been using transformable attributes in core data to transform complex objects like images and colors into raw data. I took this... The idea behind transformable attributes is that you access an attribute as a non-standard type, but behind the scenes Core Data uses an instance of NSValueTransformer to convert the attrib...
I'm having some very basic problems changing line color/width when drawing different lines (intended for a chart) with NSBezierPath. The following code should make it clear what I'm trying to do: #import "DrawTest.h" @implementation DrawTest - (id)initWithFrame:(NSRect)frameRect { NSLog(@"in 'initWithFrame'..."); if ((self = [supe...
I have most of the code that works [self.disclosureButton setBezelStyle:NSDisclosureBezelStyle]; [self.disclosureButton setButtonType: NSPushOnPushOffButton]; [self.disclosureButton setTitle:nil]; [self.disclosureButton highlight:NO]; However, when I press the button, it turns black to indicate the press. How do I get it to stop chang...
Hi, In Objective-C, why [object doSomething]? Wouldn't it be [*object doSomething] since you're calling a method on the object, which means you should dereference the pointer? Thanks! ...
In Aaron Hillegass' Cocoa Programming for Mac OS X, Chapter 9, the section called "Begin Editing on Insert", he explains how to do exactly that. The thing that confused me though, was that he did a bunch of other stuff. Here's the full code listing: - (IBAction)createEmployee:(id)sender { NSWindow *w = [tableView window]; // Try to end...
I am getting a (what seems to me as a strange) crash with Core Data. From what I can gather it is happening when Core Data does a save and subsequent managedObjectContextDidSave methods are fired. I am at a loss and really hoping someone can help me out or guide me in the right direction. The crash report is as follows: Exception Type...
Hi, What is the best way to rename the app so that the title below the app icon can have spaces but the build files doesn't have spaces. (ie, title is "My Project" and build file is MyProject.app) I changed PRODUCT_NAME but when I do that the app file also contains spaces. Renaming all the fields seems to work fine except I can't find...