cocoa

Core Data with in-memory store

I want to use Core Data as a cache for a larger dataset on a database server. Not all data will be in memory. When thinking about this further 2 questions came to mind: Can faulting (for example for 1-n relationships) be used with the in-memory persistent store, and if so, how do you a catch a fault firing? A Core data managed object...

Why isn't my variable being assigned

Ok I think my understanding of properties in objective c may not be what I thought it was. In my program I have a singleton that contains my class. In my class during the init I assign a value from the singleton to my property. I then assign a value to a property of that property. However it does not keep the value and when I do a co...

Is there a way to make a custom NSWindow work with Spaces

I'm writing an app that has a custom, transparent NSWindow created using a NSWindow subclass with the following: - (id)initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)flag { self = [super initWithContentRect:contentRect styleMask:NSBorderlessWindowMask backin...

How do you position a larger NSImage inside of a smaller NSImageView programmatically?

Let's say I have an NSImage that's 100x100. I also have an NSImageView that's 50x50. Is there a way I can place the NSImage at coordinates inside the NSImageView, so I can control which part of it shows? It didn't seem like NSImage had an initWithFrame method... ...

iphone sdk see size of local file (one created by application)

Is there anyway I can look at the size of a file the application creates in bytes then store that number to use later? OR is there any way I can tell if an object in an NSArray is empty, I've tried everything, but it just doesn't work! ...

Color Indicator in the Status Bar?

I am trying to make my status bar menu have a background color [green/yellow/red] depending on a given status. I think the Level Indicator Cell should be helpful, but how can it be put in the status bar? A relevant blog article: http://dacc.exaptic.com/2009/02/color-status-bar-in-cocoa-with-nsindicator/ ...

NSLevelIndicator with text on It?

How can I add text on top of a NSLevelIndicator? [the NSLevelIndicator is in my statusbar, if that matters] ...

Best implementation for iTunes-like playlist structure?

I'm creating an app that has a master-detail interface, similar to iTunes. It has the same data hierarchy as iTunes' playlists (except that I'm not allowing groups of "playlists" to keep things simple). In other words, there are normal playlists where their only items are added manually by the user. There are smart playlists, which sh...

Simply adding data to an NSBrowser?

I have a tree data structure which I would like to put into an NSBrowser. I have found complicated methods that involve App Delegates, but I would just like to insert the rows as I come across them. ...

[objective-c, NSMutableArray] about removeObjectAtIndex.

appdata.items is NSMutableArray object. source code -(void)deleteAppDataItemId:(NSInteger)identifier{ NSLog(@"%@", [appdata.items objectAtIndex:identifier]); NSLog(@"%i", identifier); [appdata.items removeObjectAtIndex:identifier]; } log 2009-11-08 21:53:01.683 xxx[14283:207] ( 200, "", 2009-11-08 21:52:53 +0...

Searching the Mac OSX system dictionaries?

I'd like to search for words in the OS X system dictionary (or dictionaries) using a simple glob or regex rather than a known text. (Currently I'm using /usr/share/dict/words instead, but the OSX dict would be a lot nicer.) The Dictionary Services interface is quite limited and doesn't allow this, but it seems like DSGetTermRangeInStrin...

Convert plain text to latex code programmatically

I'd like to take some user input text and quickly parse it to produce some latex code. At the moment, I'm replacing % with \% and \n with \n\n, but I'm wondering if there are other replacements I should be making to make the conversion from plain text to latex. I'm not super worried about safety here (can you even write malicious latex ...

Ignoring UI Events in AppKit

If I wanted to ignore a touch event in UIKit on the iPhone I would simply do: // Begin ignoring events [[UIApplication sharedApplication] beginIgnoringInteractionEvents]; //Do my code // Stop ignoring events [[UIApplication sharedApplication] endIgnoringInteractionEvents]; This allows my code in between the "ignore" calls to operate ...

Nesting controls inside NSTableView rows

Is there a way to nest complex views - in particular an NSTokenView - inside each row of an NSTableView or NSOutlineView? ...

Core Data: multiple entities related to a single entity

I have an entity called 'SyncInfo' (including a UUID and a modified date) that I want other entities in my data model to have an instance of (i.e. employee/department). Is there a simple way to get Core Data to allow me to do this without requiring that SyncInfo have relationships with every single one of the other entities in the data ...

Implementing parent->child drill down in Cocoa with Core Data bindings that span multiple entities

I'm trying to create a simple interface to my core data model in the style of iTunes Genre browser. I have a model setup with three entities: Genre <-->> Artist <-->> Album. I'd like to simply tie them each to a NSTableView, but it appears as though accessing children relationships from a NSArrayController is not KVC compliant. So, I'...

How to tell if a given path is mounted removable media in Mac OS X?

Given a path, in Mac OS X, is there a way to tell that it is a mounted CD or DVD, as opposed to a regular directory, a regular file, or mounted DMG or other mountable file type? Specifically I would like to know if it is a CD or DVD when a user supplies a path directly, or via the NSOpenPanel, or drags the CD onto the app. I need to ta...

Where can I find RSS feeds for Xcode Documentation?

Occasionally I like to work completely disconnected from a network. In those cases it's really nice to have complete sets of documentation on my Mac. Xcode supports subscribing to feeds of documentation. I've subscribed to the sets that I'm interested in but there's a problem: It doesn't appear that the lists are up to date. I'd like...

Need help sorting mulitple NSMutableArrays

I have high scores (name, score, time) stored in a single file and I divide them into separate arrays once it reads them, only problem is i cant figure out a way to sort all three by score and time from least to greatest and still keep the correct order of values. For example: Name score time --------------- nathan 123 01:12 bob 321 ...

How to set modification date every time NSManagedObject changes?

Every time one of my managed objects is modified, I want to store the date it was modified (in an attribute which is already in my data model), for convenience when I'm syncing with other clients. Is there a way to do this without A) re-writing all my setters manually or B) relying on myself to always change the modification date every ...