Re: NSDocument custom file Package or URL override?

2013-05-17 Thread Trygve Inda
On 5/15/13 5:14 PM, Trygve Inda wrote: My document format needs to look like: File (actually a directory marked as a package) -- MyData.plist - Images (directory) Image1.png Image2.png - Data (directory) Data1.dat Data2.dat - Icons (directory) Icon1.png

Re: NSMutableDictionary or Custom Object when adding properties?

2013-05-17 Thread Trygve Inda
On May 17, 2013, at 12:43 AM, Trygve Inda wrote: I need to keep a small (few thousand) record database of sorts. Each record has some pre-detertermined fields, but the user can add there own fields to to a limited extent. … This will be simple objects in an NSMutableArray. I can use

Re: NSMutableDictionary or Custom Object when adding properties?

2013-05-17 Thread Trygve Inda
On May 17, 2013, at 1:18 AM, Trygve Inda wrote: On May 17, 2013, at 12:43 AM, Trygve Inda wrote: The trouble comes in the fact that I need to be able to add properties at runtime. For the dictionary option, it is easy - just make sure the key names don't collide and I can add more keys

NSPredicate on sub array items?

2013-05-17 Thread Trygve Inda
I have an NSArray managed by an NSArrayController (object class people) with each people object containing an NSArray: People[0] Fistname (String) = John Lastname (String) = Smith Items (NSArray) --Item[0] (String) = Boat --Item[1] (String) = Car People[1] Fistname (String) = Bob Lastname

Re: NSMutableDictionary or Custom Object when adding properties?

2013-05-17 Thread Trygve Inda
On May 16, 2013, at 11:41 PM, Graham Cox graham@bigpond.com wrote: There is setValue:forUndefinedKey: and then each object could keep a local dictionary of these defined at runtime keys. There are low-level runtime methods that allow you to add properties at runtime. I'm not sure

NSMutableDictionary or Custom Object when adding properties?

2013-05-16 Thread Trygve Inda
I need to keep a small (few thousand) record database of sorts. Each record has some pre-detertermined fields, but the user can add there own fields to to a limited extent. It is a pretty light use so CoreData isn't what I really want, plus migrating to future structures is an issue with CoreData.

NSDocument custom file Package or URL override?

2013-05-15 Thread Trygve Inda
My document format needs to look like: File (actually a directory marked as a package) -- MyData.plist - Images (directory) Image1.png Image2.png - Data (directory) Data1.dat Data2.dat - Icons (directory) Icon1.png Icon1.png In my NSDocument subclass, Overriding:

IOS iPad PopOver Nav bar color

2013-02-17 Thread Trygve Inda
I have a popover view and would like a nav-like title bar on it in a dark color that matches the frame gradient of the popover fram. I can make the nav bar grey or black, but can't seem to get it to apply the gradient that the frame has. Ical seems to be able to do this when you tap Calendars in

DisplayReconfigurationCallBack with nil cgDisplayID

2012-08-23 Thread Trygve Inda
Very occasionally when my MyDisplayReconfigurationCallBack is called: void DisplayReconfigurationCallBack (CGDirectDisplayID cgDisplayID, CGDisplayChangeSummaryFlags flags, void *userInfo) The system sends me a nil value for cgDisplayID When I try to cycle through the array of NSScreen to find

AuthorizationExecuteWithPrivileges vs SMJobBless

2012-08-09 Thread Trygve Inda
I am using AuthorizationExecuteWithPrivileges to copy a prefPane from its installed location to the trash as part of the action on an uninstall button. It runs /bin/mv on the file/package Of course this is only if the pane is in /Library/PreferencePanes since if it is in

Power Nap causing NSTimer to fire immediately

2012-08-04 Thread Trygve Inda
When our software is running and the Mac goes into Power Nap, our NSTimers (which are fire-once and set to 3 hour periods) are firing immediately, so the software does the timer work and installed a new fire-once timer for 3 hours later. Except that one of course fires immediately and it just

Re: Power Nap causing NSTimer to fire immediately

2012-08-04 Thread Trygve Inda
When our software is running and the Mac goes into Power Nap, our NSTimers (which are fire-once and set to 3 hour periods) are firing immediately, so the software does the timer work and installed a new fire-once timer for 3 hours later. Except that one of course fires immediately and it

NSTimer fireDate on invalidated timer not working according to docs

2012-08-03 Thread Trygve Inda
NSTime docs say: -- The date at which the receiver will fire. If the timer is no longer valid, this method returns the last date at which the timer fired. -- For an invalidated timer I am seeing a fireDate of: 2001-01-01 00:00:00 But I know it fired at 2012-08-03 19:39:12 Is this a known bug?

Invalidate non-repeating NSTimer after fired?

2012-08-03 Thread Trygve Inda
NSTimer* myTimer = [NSTimer scheduledTimerWithTimeInterval:60 target:self selector:@selector(wantsUpdate:) userInfo:nil repeats:NO] Sometime after it fires (and occasionally before), I call if ( myTimer ) { [myTimer invalidate]; [myTimer release]; myTimer = nil; } Should I really be

Re: Invalidate non-repeating NSTimer after fired?

2012-08-03 Thread Trygve Inda
You must use the 2nd way. If you don't you could get a memory exception if the timer has fired and, therefore, been invalidated. On Aug 3, 2012, at 4:19 PM, Trygve Inda wrote: My code looks like this: -(void)awakeFromNib { [self setUpdateTimer:[NSTimer

Re: Using NSTerminateLater with a Status Item

2012-07-26 Thread Trygve Inda
Hi Olivier. rdar://problem/6001460 See http://lapcatsoftware.com/rdar/6001460/index.html for an explanation. In short, you won't be able to do it with a LSUIElement app. -Jeff Is there a work-around for this? I need to delay shutdown of a LSUIElement app during logout for a few

Mission Control Hiding Window

2012-07-25 Thread Trygve Inda
I have a window that is the size of the display and has a z-order to put it between the desktop picture and icons. I call: setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces | NSWindowCollectionBehaviorTransient | NSWindowCollectionBehaviorIgnoresCycle This lets it move betwen

Crash in System Prefs when installing PrefPane

2012-07-04 Thread Trygve Inda
I am getting a crash in SysPrefs: objc_msgSend() selector name: alloc com.xericdesign.earthdesk.prefPane v.821 (MyPrefPane) objc[7541]: garbage collection is ON Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libobjc.A.dylib 0x7fff9067404d objc_msgSend_vtable1

Re: Prevent Quarantine message on helper app

2012-07-03 Thread Trygve Inda
On Jul 2, 2012, at 5:10 PM, Trygve Inda wrote: When users open my prefpane for the first time they get the OS quarantine message. Then my prefpane has to open a helper app and it pauses for about 30 seconds and then throws up another quarantine message... This time for the helper. How

Prevent Quarantine message on helper app

2012-07-02 Thread Trygve Inda
When users open my prefpane for the first time they get the OS quarantine message. Then my prefpane has to open a helper app and it pauses for about 30 seconds and then throws up another quarantine message... This time for the helper. How can I have the main app prevent the quarantine message on

NSPreferencePane isSelected error

2012-03-03 Thread Trygve Inda
In my PrefPane I receive a distributed notification from another app and call: [myPane isSelected]; It should return true and it does, unless I have this in my delegate: -(void)didSelect { // it doesn't matter what goes here - even nothing at all results in isSelected returning NO;

selectedTag binding weirdness

2012-02-01 Thread Trygve Inda
I have a popup menu for which I call: [myPopup bind:@selectedTag toObject:myDict withKeyPath:@myItem options:NULL]; If I use the GUI to set change the popup value, myDict.myItem is updated accordingly. But if I use: [myPopup selectItemAtIndex:1]; It isn't I have to use [myDict

Codesign non-AppStore build with AppStore signing identity

2011-10-05 Thread Trygve Inda
One of our apps (distributed via our website) is not signed. It seems that Parental Controls signs our app behind our back to do what it does. This obviously alters our app and breaks some integrity checks. A Tech Note says that simply signing it will fix this. Can we just sign it the same way

Re: KVO on objects in NSArrayController

2011-09-03 Thread Trygve Inda
On 2011 Sep 02, at 22:22, Trygve Inda wrote: Briefly, you can configure the checkbox cell (either in IB or programmatically) to have an action… I think this sounds like a much better option than trying to use KVO. Indeed it is, *if* you literally want the notification, as you said

KVO on objects in NSArrayController

2011-09-02 Thread Trygve Inda
I have an array of objects (of class MyObject) managed by an NSArrayController and displayed in an NSTable (via bindings). One property of MyObject is a BOOL marked. I need to be notified whenever the user toggles a marked checkbox in my NSTable. What is the best way to do this? Do I need to

Re: KVO on objects in NSArrayController

2011-09-02 Thread Trygve Inda
On Sep 2, 2011, at 19:01 , Trygve Inda wrote: I have an array of objects (of class MyObject) managed by an NSArrayController and displayed in an NSTable (via bindings). One property of MyObject is a BOOL marked. I need to be notified whenever the user toggles a marked checkbox in my

Re: NSArrayController nib binding vs code binding

2011-07-19 Thread Trygve Inda
On 19 Jul 2011, at 02:41, Trygve Inda wrote: [myArrayController bind:@content toObject:myClassObject withKeyPath:@places options:NULL]; Hmm... Seems like it should be bind:@contentArray Please use the NSContentArrayBinding constant as that's what's it exists for, despite being fairly

NSArrayController nib binding vs code binding

2011-07-18 Thread Trygve Inda
I have a class (MyClass) that conforms to the collection methods for mutable collections such as... -(void)insertKey:(NSArray *)locationArray atIndexes:(NSIndexSet *)indexes In my nib I have an NSArrayController and an instance of MyClass My binding for the NSArrayController content looks

Re: NSArrayController nib binding vs code binding

2011-07-18 Thread Trygve Inda
I have a class (MyClass) that conforms to the collection methods for mutable collections such as... -(void)insertKey:(NSArray *)locationArray atIndexes:(NSIndexSet *)indexes In my nib I have an NSArrayController and an instance of MyClass My binding for the NSArrayController content

Re: NSArrayController nib binding vs code binding

2011-07-18 Thread Trygve Inda
On Jul 18, 2011, at 18:41, Trygve Inda wrote: The other possibly related issue is that I have my table delegate defined in the nib and seem to get -(void)tableViewSelectionDidChange:(NSNotification *)aNotification Before awakeFromNib which means my binding has not taken place yet. Do I

Re: NSDatePicker weirdness with time.

2011-07-06 Thread Trygve Inda
On Wed, Jul 6, 2011 at 7:11 AM, Fritz Anderson fri...@manoverboard.org wrote: On 6 Jul 2011, at 12:16 AM, Trygve Inda wrote: It seems that NSDateFormatters instantiated in my nibs get their zone set to PDT (because of my time settings), despite having called [NSTimeZone

NSDatePicker weirdness with time.

2011-07-05 Thread Trygve Inda
In my app I have: [NSTimeZone setDefaultTimeZone:[NSTimeZone timeZoneWithAbbreviation:@GMT]];// So that when we decode NSDate objects, we get the h/m/s as GMT I also have an NSDatePicker set to only show the hh:mm My system clock is set to US West Coast Time and US format. When I

Re: NSDatePicker weirdness with time.

2011-07-05 Thread Trygve Inda
Trygve, That should work. I suspect that you are setting the timeZone of the NSDatePicker as well. There is a bug, where is you set the NSDatePicker timeZone but do not set the calendar, then you will run into this problem. (Same thing with NSDatePicker locale.) So, either don't adjust

Click in borderless window moves all windows to front

2011-04-14 Thread Trygve Inda
My App has one borderless window which I fill with custom views for the grow box, title bar and content. It all works great except when I click this window, all my app's windows move to the front. How can I prevent this? Thanks, T. ___ Cocoa-dev

GraphicsImportGetMetaData and 64bit

2011-02-26 Thread Trygve Inda
I am looking for a 64 bit solution to read a comment from a JPEG file... Any ideas? This does not work (it gets a dictionary containing image properties like size, but the text comment I am interested in is not there): NSURL*url = [NSURL fileURLWithPath:path]; CGImageRef

Re: IBOutlet to different classes, conditional build

2011-02-24 Thread Trygve Inda
On 24/02/2011, at 5:56 PM, Trygve Inda wrote: The problem is two-fold: 1) How can I have nibs, one with MyObjectClass:NSObject and the other with MyObjectClass:NSPreferencePane where MyObjectClass is essentially the same but with a few #ifdef to have conditional compilation

Re: IBOutlet to different classes, conditional build

2011-02-24 Thread Trygve Inda
On 24/02/2011, at 5:56 PM, Trygve Inda wrote: The problem is two-fold: 1) How can I have nibs, one with MyObjectClass:NSObject and the other with MyObjectClass:NSPreferencePane where MyObjectClass is essentially the same but with a few #ifdef to have conditional compilation

Re: IBOutlet to different classes, conditional build

2011-02-24 Thread Trygve Inda
On 25/02/2011, at 7:16 AM, Trygve Inda wrote: I am guessing IB is reading the MyClass.m which has both .h files imported with #ifdef I don't think this is true - I have sometimes defined the header for a class and then set up the interface in IB using that header before I've even

Re: IBOutlet to different classes, conditional build

2011-02-24 Thread Trygve Inda
On 25/02/2011, at 10:26 AM, Trygve Inda wrote: It seems to be pretty random when using two header files, but a common implementation. There should be a way to drag a header to IB and have it reinterpret the class, but it just complains that the superclass is wrong. I guess the issue

Re: IBOutlet to different classes, conditional build

2011-02-24 Thread Trygve Inda
On 25/02/2011, at 11:17 AM, Trygve Inda wrote: So what file would I define this protocol in... Another header? The two .h files for the unique classes? No - just #import the protocol into these headers. It'd be nice if IB let me define a class two different ways and linked only

IBOutlet to different classes, conditional build

2011-02-23 Thread Trygve Inda
I have one project that outputs two binaries - one for the App Store (an app) and one for my own website version (a prefpane). All the classes are the same except for two: MyPrefPaneDelegate MyAppDelegate These are each in their respective apps. How can I build my shared classes so I can do:

Re: IBOutlet to different classes, conditional build

2011-02-23 Thread Trygve Inda
that to define the IBOutlet instead. The point is, all you need is a common type for both classes. On Feb 23, 2011, at 4:07 PM, Trygve Inda wrote: I have one project that outputs two binaries - one for the App Store (an app) and one for my own website version (a prefpane). All

Re: IBOutlet to different classes, conditional build

2011-02-23 Thread Trygve Inda
On 24/02/2011, at 11:23 AM, Trygve Inda wrote: So when I define MyCommonAppDelegate in the nib, it should only have the SparkleUpdate IBAction in the retail version... So this code really sits in MyPrefPaneDelegate... But how do I get IB to realize this? I am really trying not to have

Re: IBOutlet to different classes, conditional build

2011-02-23 Thread Trygve Inda
I have one project that outputs two binaries - one for the App Store (an app) and one for my own website version (a prefpane). All the classes are the same except for two: MyPrefPaneDelegate MyAppDelegate These are each in their respective apps. How can I build my shared classes

Re: IBOutlet to different classes, conditional build

2011-02-23 Thread Trygve Inda
On 24/02/2011, at 1:05 PM, Trygve Inda wrote: And this supercalss is instantiated in the nib, won't this appear in the nib somewhere even if it does not hook to the action? I can't have it that way (at last if I want to call the methods anything containing sparkle. Why not? This won't

Re: IBOutlet to different classes, conditional build

2011-02-23 Thread Trygve Inda
On 24/02/2011, at 1:16 PM, Trygve Inda wrote: Hmmm.. Mine was rejected until I totally removed all the methods too. That doesn't seem reasonable. Did you try explaining that the actual code that handles Sparkle updates has been removed? When I was initially rejected (on an unrelated

Re: IBOutlet to different classes, conditional build

2011-02-23 Thread Trygve Inda
On 24/02/2011, at 1:41 PM, Trygve Inda wrote: -(IBAction)doSparkleStuff:(id)sender; Even though this code is #ifdef'd out in the AppStore build, it seems to be a problem that the nib refers to it (it is not hooked up, but is part of the class since there is no way to make IB ignore

Re: IBOutlet to different classes, conditional build

2011-02-23 Thread Trygve Inda
On 24/02/2011, at 11:23 AM, Trygve Inda wrote: So when I define MyCommonAppDelegate in the nib, it should only have the SparkleUpdate IBAction in the retail version... So this code really sits in MyPrefPaneDelegate... But how do I get IB to realize this? I am really trying not to have

Re: IBOutlet to different classes, conditional build

2011-02-23 Thread Trygve Inda
On 24/02/2011, at 5:29 PM, Trygve Inda wrote: How can I properly set this up? I'm not sure if it's the best way, but you could just make MyObjectClass *always* an NSObject subclass, and let it act as an intermediary or controller for the real class. In other words, its interface

Re: IBOutlet to different classes, conditional build

2011-02-23 Thread Trygve Inda
On 24/02/2011, at 5:56 PM, Trygve Inda wrote: The problem is two-fold: 1) How can I have nibs, one with MyObjectClass:NSObject and the other with MyObjectClass:NSPreferencePane where MyObjectClass is essentially the same but with a few #ifdef to have conditional compilation

Re: IBOutlet to different classes, conditional build

2011-02-23 Thread Trygve Inda
On 24/02/2011, at 5:56 PM, Trygve Inda wrote: The problem is two-fold: 1) How can I have nibs, one with MyObjectClass:NSObject and the other with MyObjectClass:NSPreferencePane where MyObjectClass is essentially the same but with a few #ifdef to have conditional compilation

System Prefs trying to relaunch in 32bit mode

2011-02-16 Thread Trygve Inda
I am building a System Pref Pane. I target ppc ppc64 i386 and x86_64... Lipo -info confirms these are all in the binary, but System Preferences launches in 32bit mode when I try to install my pane. In a previous project it works, so I am not sure what is happening. The error reported is:

Parental Controls altering binary

2011-01-16 Thread Trygve Inda
When our app (actually a System Pref Pane) is run on a non-Admin account with Parental Controls, it seems the binary is getting modified which causes a checksum problem for verification of updates etc. Has anyone else seen this? Trygve ___ Cocoa-dev

Re: NSDictionary allValues not mutable

2010-10-19 Thread Trygve Inda
I’d say the best solution is the one that Ken described. Implement the to-many accessors such as countOfproperty, objectInpropertyAtIndex:, insertObject:inpropertyAtIndex:, and so forth. Then the underlying storage can be an NSDictionary, a skip list, or whatever you want, and as long as your

Re: NSDictionary allValues not mutable

2010-10-19 Thread Trygve Inda
I’d say the best solution is the one that Ken described. Implement the to-many accessors such as countOfproperty, objectInpropertyAtIndex:, insertObject:inpropertyAtIndex:, and so forth. Then the underlying storage can be an NSDictionary, a skip list, or whatever you want, and as long as

NSArrayController making copies of my objects?

2010-10-18 Thread Trygve Inda
I am trying to figure out exactly what is happening here. I have a mutable dictionary where each object is also an NSMutableDictionay containing 9 string objects. NSMutableDictionary* myData;// this is in MyController object. In a window, I have an NSTableView whose column data is tied to

Re: NSDictionary allValues not mutable

2010-10-18 Thread Trygve Inda
So if the master dictionary and the array for the NSTable are encapsulated together in a class, you could use NSMutableArray as the primary structure, and encapsulate a hidden NSMutableDictionary used only for faster searching. Both are maintained in parallel by the enclosing class, so

Re: NSDictionary allValues not mutable

2010-10-18 Thread Trygve Inda
On Oct 18, 2010, at 10:22 AM, Trygve Inda wrote: So if the master dictionary and the array for the NSTable are encapsulated together in a class, you could use NSMutableArray as the primary structure, and encapsulate a hidden NSMutableDictionary used only for faster searching. Both

Re: NSDictionary allValues not mutable

2010-10-18 Thread Trygve Inda
On Oct 18, 2010, at 10:22 AM, Trygve Inda wrote: So if the master dictionary and the array for the NSTable are encapsulated together in a class, you could use NSMutableArray as the primary structure, and encapsulate a hidden NSMutableDictionary used only for faster searching. Both

Re: NSDictionary allValues not mutable

2010-10-18 Thread Trygve Inda
On Oct 18, 2010, at 10:59 AM, Trygve Inda wrote: I guess I am just not seeing how my NSArrayController would ties to this. So I have a class MyDataClass and since my NSTableView is tied to an NSArrayController, then the NSArrayController needs to get it's data from MyDataClass. So

Re: NSArrayController making copies of my objects?

2010-10-18 Thread Trygve Inda
On Oct 18, 2010, at 04:43, Trygve Inda wrote: I understand that the array returned by allValues is not mutable so the NSArrayController may need to make a mutable copy of it, but the internal objects are mutable... So why is it copying my objects? If I add the following just before

Re: NSDictionary allValues not mutable

2010-10-18 Thread Trygve Inda
You are mistaking instance variables for properties. Instance variables are implementation details, and nothing outside of your class should be aware of them. Properties are part of your interface, essentially the accessor methods and their behavior. (Remember that you can have

Re: NSDictionary allValues not mutable

2010-10-18 Thread Trygve Inda
On Oct 18, 2010, at 4:22 PM, Trygve Inda wrote: How does it derive the plural for he method name countOfWeapons from the class name Weapon? It doesn’t. The property name is “weapons” in this case, the same name it would have had if it had been an NSArray. The only difference

Re: NSDictionary allValues not mutable

2010-10-18 Thread Trygve Inda
Trygve Inda wrote: Each dictionary (or object with properties) will need to hold roughly 9 textual strings, and there will be on the order of 10,000 objects in the array. I am guessing that dictionary will perform better than a predicate filter given the number of objects. Never

NSDictionary setValue KVO

2010-10-10 Thread Trygve Inda
I have a controller object with an ivar myDict I have a nib with an NSArrayController bound to this object with a keypath of mydi...@allvalues This works, but when I want to add an item to the dict (and have it reflected in the arraycontroller), the method in my object is: [self

NSDictionary allValues not mutable

2010-10-09 Thread Trygve Inda
I have an NSMutableDictionary made from a plist with CFPropertyListCreateDeepCopy so that all leaves and containers are mutable. In this plist is an dict whose values I want to move into a mutable array to be displayed and edited in an NSTable. [myDict allValues] gets the correct array and works

Re: NSDictionary allValues not mutable

2010-10-09 Thread Trygve Inda
I have an NSMutableDictionary made from a plist with CFPropertyListCreateDeepCopy so that all leaves and containers are mutable. In this plist is an dict whose values I want to move into a mutable array to be displayed and edited in an NSTable. [myDict allValues] gets the correct array

Re: NSDictionary allValues not mutable

2010-10-09 Thread Trygve Inda
Of course it is. Suppose for a minute that [myMutableDictionary allValues] returned a mutable array. That means that you could add to and remove from this array with impunity. Except... the objects in this array are supposed to have an associated key. If you remove an object from the

Partially opaque window with opaque views

2010-10-05 Thread Trygve Inda
Is there a way to have a window with a 50% opaque background, but several odd-shaped views that are 100% opaque? The dock does this but seems be one window per icon. Can I do it all as one window? My NSWindow subclass looks like: [self setOpaque:NO]; [self setHasShadow: YES]; [self

Re: NSMutableDictionary crash on PPC

2010-09-29 Thread Trygve Inda
On Sep 28, 2010, at 22:48, Trygve Inda wrote: [myObject removeObjectForKey:myDict]; Shouldn't that be: [myObject removeObjectForKey:myOldKey]; ? Yes. Sorry - typing in Mail. Correct code (still crashes on PPC) myDict = [myObject objectForKey:myOldKey]; if (myDict

Re: NSMutableDictionary crash on PPC

2010-09-29 Thread Trygve Inda
Did you read my post about retaining things before you remove them from dictionaries? myDict = [myObject objectForKey:myOldKey]; if (myDict) { [myObject removeObjectForKey: myOldKey]; [myObject setValue:myDict forKey:myNewKey]; [[NSUserDefaults standardUserDefaults]

NSMutableDictionary crash on PPC

2010-09-28 Thread Trygve Inda
I am getting a crash after calling synchronize. I am trying to change the key associated with an object as follows: myDict = [myObject objectForKey:myOldKey]; if (myDict) { [myObject removeObjectForKey:myDict]; [myObject setValue:myDict forKey:myNewKey]; [[NSUserDefaults

CGDisplayChangeSummaryFlags

2010-09-23 Thread Trygve Inda
In my DisplayReconfigurationCallBack, the CGDisplayChangeSummaryFlags has bit 13 set when the GPU changes on an i5/i7 Mac. Only bits 0-12 are defined in the header. Is this documented anywhere else? During a GPU switch I get: 1st: 8478 kCGDisplayMovedFlag kCGDisplaySetMainFlag

i5/i7 w/External 24 LED Cinema identifying screens - testing help

2010-09-21 Thread Trygve Inda
Does anyone here have the above set up... And are willing to test a small app to retrieve display information? Since these machines have two processors for video, the CGDirectDisplayID is not unique any longer and we are looking for ways to uniquely identify a screen. Please contact me off list.

Re: i5 i7 auto graphics switching

2010-09-17 Thread Trygve Inda
Le 13 sept. 2010 à 17:03, Trygve Inda a écrit : How do I get the CGDirectDisplayID into IORegistryEntryCreateCFProperties? Is this any different than: io_service_tservicePort = CGDisplayIOServicePort (myCGDirectDisplayID); CFDictionaryRef oldInfoDict

Re: i5 i7 auto graphics switching

2010-09-13 Thread Trygve Inda
2010/9/12 cocoa-dev-requ...@lists.apple.com When it is running on the slow card, the CGDirectDisplayID will be x, and on the fast card it will be y. Is there anyway to derive x from y or y from x? I am trying to be able to uniquely identify screens even before/after a processor switch.

Re: i5 i7 auto graphics switching

2010-09-12 Thread Trygve Inda
On Sep 11, 2010, at 10:57 PM, Trygve Inda wrote: On Sep 11, 2010, at 10:52 AM, Trygve Inda wrote: Is there a way to be notified when the graphic card is switched? NSApplicationDidChangeScreenParametersNotification When it is running on the slow card, the CGDirectDisplayID will be x

i5 i7 auto graphics switching

2010-09-11 Thread Trygve Inda
Is there a way to be notified when the graphic card is switched? Some flags in CGDisplayRegisterReconfigurationCallback perhaps? I am trying to keep track if physical displays on multi-screen systems. With NSScreen, the screen number will change if for example the user has a laptop with an

Re: i5 i7 auto graphics switching

2010-09-11 Thread Trygve Inda
On Sep 11, 2010, at 10:52 AM, Trygve Inda wrote: Is there a way to be notified when the graphic card is switched? NSApplicationDidChangeScreenParametersNotification That fires when the GPU is switched, as well as well displays are rearranged or reconfigured. Regards, Ken Thanks Ken

zib works in Dubug, not in Release

2010-08-30 Thread Trygve Inda
I am uncompressing data with zlib: err = uncompress( buffer, bufferLength, (const Bytef*)data + sizeof( uLongf ), [self length] - sizeof( uLongf ) ); This works when I build a debug target, but not when I build a release target. I have verified the data sent into each target is the same. In

Re: zib works in Dubug, not in Release

2010-08-30 Thread Trygve Inda
I am uncompressing data with zlib: err = uncompress( buffer, bufferLength, (const Bytef*)data + sizeof( uLongf ), [self length] - sizeof( uLongf ) ); This works when I build a debug target, but not when I build a release target. I have verified the data sent into each target is the

IKImageBrowser and non-square cells

2010-06-01 Thread Trygve Inda
I am using 10.6 and despite setting IKImageBrowser to use nonsquare cells, it seems to force everything back to square. My images are wide, but not very tall, yet it is forcing the title text to be a longs way away since the cell size is being forced back to square. Ideas?

List of all supported apps for file type

2010-05-23 Thread Trygve Inda
I know I have seen this code before but in the last 30 minutes of digging, I can't find it. How can I get a list of bundle identifiers (or paths to an app) for all the apps that can open a file of a given type (eg pdf, mp3 etc) Then, How can I get an icon for these apps? Basically I want to

PopupButton image scaling

2010-05-21 Thread Trygve Inda
I have a popup button in either the square or gradient style with an image of NSActionTemplate. I set the image scaling to proportionally down, and in IB it looks fine, but when I run the app, the image is completely filling the button, instead of a nice small image. Any Ideas? Trygve

Re: KeyPathsForValuesAffectingValueForKey confusion

2010-05-10 Thread Trygve Inda
On May 10, 2010, at 9:12 AM, Trygve Inda wrote: I have an NSArrayController containing items and a text field in a window which is bound to a custom class MyController via model key path: filteredResultsString -(NSString *)filteredResultsString { return ([[NSNumber numberWithInt

NSListViewTemplate invert

2010-05-06 Thread Trygve Inda
The NSListViewTemplate and other NSImages provided in IB invert when put into a button. How can I create a similar image so that when placed in a NSSegmentedControl in a toolbar, I can get the same effect? Or maybe I need to manually swap the image when the button is clicked? Perhaps this is

Re: NSListViewTemplate invert

2010-05-06 Thread Trygve Inda
The NSListViewTemplate and other NSImages provided in IB invert when put into a button. How can I create a similar image so that when placed in a NSSegmentedControl in a toolbar, I can get the same effect? Or maybe I need to manually swap the image when the button is clicked? Perhaps this

Prevent NSTableView deactivate when window active

2010-05-02 Thread Trygve Inda
The Finder is able to keep both a SourceView and a Table view active at the same time... Both highlight in the active mode as long as the window is active. The Table seems to always have the keyboard focus. How can I achieve the same thing in my app without resorting to custom drawing? Thanks,

Design pattern for collection of items and many subsets

2010-04-30 Thread Trygve Inda
I'm trying to determine the best way to build this for scalability, performance and maintainability. I have a Source List which at the top contains a masterArray of NSDictionary items. Below that I have several dumbLists and smartLists which are subsets of the items in the masterArray as

Re: Design pattern for collection of items and many subsets

2010-04-30 Thread Trygve Inda
Let me re-phrase this to make it more clear. I have something like Mail. It receives messages and these get stored in a master box. I have dumbBoxes which are lists that the user can drag messages to. I also have smartBoxes that filter based on criteria. Right now, when the user clicks on a box

Re: NSPredicateEditor losing nextKeyView

2010-02-23 Thread Trygve Inda
On Feb 21, 2010, at 9:50 PM, Trygve Inda wrote: In my sheet, I have a name NSTextField and an NSPredicateEditor. Initially, the tab key works to jump between my name field and the first match field in the predicate editor. However, after changing any of the menus in the line of my

NSPredicateEditor losing nextKeyView

2010-02-21 Thread Trygve Inda
In my sheet, I have a name NSTextField and an NSPredicateEditor. Initially, the tab key works to jump between my name field and the first match field in the predicate editor. However, after changing any of the menus in the line of my predicate editor, the tab key no longer allows the keyfield to

Re: Bind to string (path), convert to NSImage

2010-02-15 Thread Trygve Inda
could eventually conflict with Apple's own collection operators. -Steven 2010/2/15 Trygve Inda cocoa...@xericdesign.com I have an NSImageWell (or NSView). I am using an NSCollectionView and have it bound to an ArrayController which is bound to an array of NSDictionary. The dicts have

IKImageBrowserView vs NSCollectionView and scaling

2010-02-15 Thread Trygve Inda
Is there any nice way to get NSCollectionView to scale its images the way IKImageBrowserView does? It is much easier to customize the item views with NSCollectionView and the only thing really lacking is scaling of the subviews... It also binds a lot nicer than IKImageBrowserView. Thanks,

Bind to string (path), convert to NSImage

2010-02-14 Thread Trygve Inda
I have an NSImageWell (or NSView). I am using an NSCollectionView and have it bound to an ArrayController which is bound to an array of NSDictionary. The dicts have several keys, among them @name and @iconpath @iconpath is a NSSting that contains a path to an NSImage. How can I bind though my

Crash while drawing cell in NSOutlineView

2010-02-13 Thread Trygve Inda
In code based largely on Apple's SourceView, I am drawing by IconAndTextCell and getting a crash... Anyone seen this and know what it might be? I have added code to draw a badge which I am updating frequently - if I only call it once, it works ok... But if it is called rapidly I get: Thread 0

Re: Crash while drawing cell in NSOutlineView

2010-02-13 Thread Trygve Inda
Trygve Inda (cocoa...@xericdesign.com) on 2010-02-14 22:13 said: In code based largely on Apple's SourceView, I am drawing by IconAndTextCell and getting a crash... Anyone seen this and know what it might be? I have added code to draw a badge which I am updating frequently - if I only

Re: Best class for pixel-level image processing?

2010-02-12 Thread Trygve Inda
I am writing an application that wants to perform some basic computer vision computation, and I want a class that offers pixel-level access to an image. What would be the best way to approach this? Do something like: MyImageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL

@distinctUnionOfArrays problem

2010-02-12 Thread Trygve Inda
I am trying to get @distinctUnionOfArrays to work with bindings. I have a Master NSArrayController. This contains an array of NSMutableDictionary objects. Each Dictionary has three NSString keys/fields: Genre, Artist, Album. I set the content of the Master Controller to my NSMutableArray and all

Re: @distinctUnionOfArrays problem

2010-02-12 Thread Trygve Inda
I am trying to get @distinctUnionOfArrays to work with bindings. I have a Master NSArrayController. This contains an array of NSMutableDictionary objects. Each Dictionary has three NSString keys/fields: Genre, Artist, Album. I set the content of the Master Controller to my NSMutableArray

<    1   2   3   4   5   >