Re: Comparing path strings

2009-03-27 Thread Jean-Daniel Dupas
Le 27 mars 09 à 03:39, Adam R. Maxwell a écrit : On Mar 26, 2009, at 7:14 PM, Gregory Weston wrote: Jean-Daniel Dupas wrote: An other way may be to convert them into FSRef (using FSPathMakeRef()) and then compare them using FSCompareFSRefs() There's a risk to that solution, though. A

Re: Shortcut handling in different keyboard layouts

2009-03-27 Thread Rimas M.
In general, using character codes is the most appropriate way. It lets the matching code automatically adapt to whatever the current keyboard layout may be. If you check the character code, it doesn't matter which physical key you've pressed. Just to be sure - what character codes you are

AudioToolbox: shift playback position

2009-03-27 Thread Sergey Shapovalov
Hi all. I'm working on an audio recording / playback application for iPhone, and use Apple's sample project SpeakHere as a starting point. Everything works all right; however, there's just one thing I can't figure out how to do. While playback, I want to be able to pause playing (via

Getting the Generic Hard Disk Icon?

2009-03-27 Thread Dave
Hi All, Where can I get the Icon for the standard Internal Hard Disk Icon? I've looked in /System/Library/CoreServices/CoreTypes.bundle/Contents/ Resources and found a lot of icon's there, but not one for the hard disk. I just want the Icon the Finder displays for the internal hard drive.

Re: Getting the Generic Hard Disk Icon?

2009-03-27 Thread Robert Tillyard
Hello, Dave, There might be a better way but I've been using: NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:@/]; You will need to know the UNIX path of the disk first. Regards, Rob. On 27 Mar 2009, at 10:58, Dave wrote: Hi All, Where can I get the Icon for the standard

Preventing highlight of RowSelection in NSTableView

2009-03-27 Thread Sourabh Sahu
Hi Everyone, How can we prevent the highlight feature , when we select row in NSTableView. I also want to shouldSelectRow return YES. Thanks Regards, -Sourabh DISCLAIMER == This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd.

Re: Getting the Generic Hard Disk Icon?

2009-03-27 Thread Mike Glass
Try this: NSString *codeStr = @hdsk; OSType code = UTGetOSTypeFromString((CFStringRef)codeStr); NSImage *picture = [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(code)]; I just happened to be in Apple's IconCollection sample code yesterday, so this is pulled pretty

Confused about superclass initializers

2009-03-27 Thread Roland King
I've thought myself into a hole in a subclass here If I have a class Foo with a subclass Bar, which adds say 2 new variables, in Bar's init method I do the usual self = [ super init ]; after someone called me with Bar *myBar = [ [ Bar alloc ] init ]; at the point I

Re: Confused about superclass initializers

2009-03-27 Thread Michael Ash
On Fri, Mar 27, 2009 at 10:53 AM, Roland King r...@rols.org wrote: I've thought myself into a hole in a subclass here If I have a class Foo with a subclass Bar, which adds say 2 new variables, in Bar's init method I do the usual        self = [ super init ]; after someone called me

Re: Confused about superclass initializers

2009-03-27 Thread Alexander Spohr
Am 27.03.2009 um 15:53 schrieb Roland King: I've thought myself into a hole in a subclass here If I have a class Foo with a subclass Bar, which adds say 2 new variables, in Bar's init method I do the usual self = [ super init ]; after someone called me with Bar

Re: Confused about superclass initializers

2009-03-27 Thread Roland King
and if I'm a moron and subclass a Foo which is ... singleton or returns one specific instance for its parameters then .. I get some cached Foo and it's my own stupid fault. [ self alloc ] makes sense .. most 'bait and switch' initializers would call that, and of course that goes back to

Re: NSFileManager: can't set group ID on 10.4

2009-03-27 Thread Sidney San Martín
I put together a test project: http://dev.deeptechinc.com/sidney/setgid_demo.zip The product takes two arguments, a GID and a filename. It was unable to change the file's group on two 10.4.11 machines (but changeFileAttributes:atPath: returned success). It worked on two 10.5 machines. Can

Image within Textfield - Show Editor at correct position

2009-03-27 Thread Heukamp Stefan
Hi, I want to implement a Textfield that shows an image at the left side, just like the addressbar in Safari. Therefore I subclassed NSTextFieldCell and overrode - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView. It draws the image and then calls super with a

Processing data maintained with Core Data

2009-03-27 Thread Peter Castine
Hello, I've been scouring the list archive while I'm learning to use Core Data, which has been a big help with many questions. But now I have a question which I've not found answered elsewhere. Brief background: I'm porting an audio generation system to Mac OS. The code for generating

several windows in a NIB ?

2009-03-27 Thread Guillaume Laurent
Hi all, I'm in the process of writing a proof-of-concept music sequencer. At the moment all I'm aiming for is putting note events into tracks. I'm using a Core Data model, which defines a Composition holding multiple Tracks, each holding multiple Events. I've already done a basic NIB for

Re: several windows in a NIB ?

2009-03-27 Thread I. Savant
On Fri, Mar 27, 2009 at 12:00 PM, Guillaume Laurent glaur...@telegraph-road.org wrote: ... it suddenly occurs to me that nothing prevents me from having several top-level windows in a single NIB, i.e. the Track Editor Panel may just as well be defined in the same NIB as the main window,

Re: several windows in a NIB ?

2009-03-27 Thread I. Savant
Oh, and leaning the other way, your problem is best solved by using a central controller as an access path to get to the other controllers. In a non-doc-based app, that'd be some central MyApplicationController with outlets to all other controllers. Those subsystem controllers would have an

clarification regarding properties

2009-03-27 Thread WT
Hello all, I'd like a little clarification, please. If I understand correctly, there *is* a difference between using self.foo and just foo, where foo is a property, right? foo = whatever just sets the value of foo to the value of whatever, but self.foo = whatever actually calls the

Re: several windows in a NIB ?

2009-03-27 Thread Sean McBride
On 3/27/09 12:11 PM, I. Savant said: ... it suddenly occurs to me that nothing prevents me from having several top-level windows in a single NIB, i.e. the Track Editor Panel may just as well be defined in the same NIB as the main window, and that simplifies things a lot. A question however

Re: clarification regarding properties

2009-03-27 Thread Nick Zitzmann
On Mar 27, 2009, at 10:24 AM, WT wrote: foo = whatever just sets the value of foo to the value of whatever, but self.foo = whatever actually calls the method setFoo: with whatever as its argument. This difference is important because the setter method might do some necessary memory

Re: several windows in a NIB ?

2009-03-27 Thread I. Savant
On Fri, Mar 27, 2009 at 12:34 PM, Sean McBride s...@rogue-research.com wrote: 3 - The nib and xib file formats to not diff merge nicely.  So if you develop in a team, it's nearly impossible for more than one person to change a nib at the same time (unlike source code).  This is a good reason

Re: Processing data maintained with Core Data

2009-03-27 Thread Quincey Morris
On Mar 27, 2009, at 08:08, Peter Castine wrote: I'm porting an audio generation system to Mac OS. The code for generating audio is in C and has run on a couple of other OSs. It's been reasonably straight forward to model the parameters for this system with Core Data, and I'm excited about

Re: clarification regarding properties

2009-03-27 Thread Alexander Spohr
Am 27.03.2009 um 17:24 schrieb WT: foo = whatever just sets the value of foo to the value of whatever, but self.foo = whatever actually calls the method setFoo: with whatever as its argument. Yes. If it is, this would be a major gotcha for Java developers new to Obj-C. In Java, this.foo =

Re: several windows in a NIB ?

2009-03-27 Thread Guillaume Laurent
On Mar 27, 2009, at 17:34 , Sean McBride wrote: On 3/27/09 12:11 PM, I. Savant said: ... it suddenly occurs to me that nothing prevents me from having several top-level windows in a single NIB, i.e. the Track Editor Panel may just as well be defined in the same NIB as the main window,

Re: clarification regarding properties

2009-03-27 Thread Quincey Morris
On Mar 27, 2009, at 09:24, WT wrote: If I understand correctly, there *is* a difference between using self.foo and just foo, where foo is a property, right? foo = whatever just sets the value of foo to the value of whatever, but self.foo = whatever actually calls the method setFoo: with

user access privileges to plist in /library/preferences

2009-03-27 Thread memo
Hi, I'd like to load/save some global preferences of my app. I have it all as an NSMutableDictionary and I load/save it as a plist in /library/preferences. If the user logged in does not have admin rights obviously the file does not save. How can I overcome this problem programatically from my

Re: Preventing highlight of RowSelection in NSTableView

2009-03-27 Thread Jerry Krinock
On 2009 Mar 27, at 04:40, Sourabh Sahu wrote: How can we prevent the highlight feature , when we select row in NSTableView. I also want to shouldSelectRow return YES. I believe this will do what you want: If you're building for Leopard only, subclass NSTableView so that this method is a

Re: user access privileges to plist in /library/preferences

2009-03-27 Thread memo
Hi Sjors, thanks for the swift reply. I'd like the file to be user independent, so it should always read/write to the same file whoever logs in (it actually collects stats of usage). Is there a better place to store the file? (has to be outside of /users) How can I overcome the privileges issue?

Re: user access privileges to plist in /library/preferences

2009-03-27 Thread Jerry Krinock
On 2009 Mar 27, at 10:44, m...@memo.tv wrote: Hi, I'd like to load/save some global preferences of my app. I have it all as an NSMutableDictionary and I load/save it as a plist in /library/preferences. If the user logged in does not have admin rights obviously the file does not save. How

Re: user access privileges to plist in /library/preferences

2009-03-27 Thread memo
Thanks Jerry, thats perfect thanks. On Fri, 27 Mar 2009 10:58:10 -0700, Jerry Krinock je...@ieee.org wrote: On 2009 Mar 27, at 10:44, m...@memo.tv wrote: Hi, I'd like to load/save some global preferences of my app. I have it all as an NSMutableDictionary and I load/save it as a plist in

Re: user access privileges to plist in /library/preferences

2009-03-27 Thread Greg Guerin
I'd like the file to be user independent, so it should always read/ write to the same file whoever logs in (it actually collects stats of usage). Is there a better place to store the file? (has to be outside of / users) How can I overcome the privileges issue? If it's just collecting

isEqual, isEqualToString, compare behaviors

2009-03-27 Thread Ameen
am not being able to explain the output of the following code; code and output pasted below. #import Cocoa/Cocoa.h int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSComparisonResult compareResult = 0; id fileAttributes = nil;

Re: OpenGL context sharing

2009-03-27 Thread Clemens Arth
Hi, yes, it might be something like this. Unfortunatly I had a fatal hard disk crash today so it will take some time until I get to the point again where I can try out what you suggested. To test that and to get more into this topic I think I will build a sample setup to get more into this

Re: clarification regarding properties

2009-03-27 Thread WT
First, thanks to all who responded to my question. On Mar 27, 2009, at 6:34 PM, Quincey Morris wrote: The 'foo' in 'self.foo' is a property. The 'foo' in 'just foo' is *not* a property, but an instance variable. It's really important to know that the two are entirely different things, even

Re: Preventing highlight of RowSelection in NSTableView

2009-03-27 Thread Corbin Dunn
On Mar 27, 2009, at 10:53 AM, Jerry Krinock wrote: On 2009 Mar 27, at 04:40, Sourabh Sahu wrote: How can we prevent the highlight feature , when we select row in NSTableView. I also want to shouldSelectRow return YES. I believe this will do what you want: If you're building for Leopard

Re: clarification regarding properties

2009-03-27 Thread Clark Cox
On Fri, Mar 27, 2009 at 11:31 AM, WT jrca...@gmail.com wrote: First, thanks to all who responded to my question. On Mar 27, 2009, at 6:34 PM, Quincey Morris wrote: The 'foo' in 'self.foo' is a property. The 'foo' in 'just foo' is *not* a property, but an instance variable. It's really

Re: clarification regarding properties

2009-03-27 Thread Sherm Pendley
On Fri, Mar 27, 2009 at 2:31 PM, WT jrca...@gmail.com wrote: On Mar 27, 2009, at 6:34 PM, Quincey Morris wrote: The 'foo' in 'self.foo' is a property. The 'foo' in 'just foo' is *not* a property, but an instance variable. It's really important to know that the two are entirely different

Re: isEqual, isEqualToString, compare behaviors

2009-03-27 Thread Yvan BARTHÉLEMY
isEqualXXX methods returns a boolean and not a NSComaprisonResult like compare:. So, for these 0 == NO, and 1 == YES. No problem then. Le 27 mars 09 à 19:30, Ameen a écrit : am not being able to explain the output of the following code; code and output pasted below. #import Cocoa/Cocoa.h

Help with implementing delegates

2009-03-27 Thread albert jordan Mobility
I am having problems with implementing delegates, and I'm sure I'm doing something silly. Would appreciate help from the experts. I can get a simple case to work, where I invoke a delegate method with no parameters passed, but I can't get the case where I invoke the delegate

Re: Help with implementing delegates

2009-03-27 Thread Greg Guerin
albert jordan Mobility wrote: In Foo, I have set up the following delegate method -(void) test: (dgtest *) sender:didFinish: (BOOL) complete Over-colonization? Try: -(void) test: (dgtest *) sender didFinish: (BOOL) complete Note the removal of the colon between sender and didFinish.

Re: Processing data maintained with Core Data

2009-03-27 Thread Matt Neuburg
On Fri, 27 Mar 2009 10:09:20 -0700, Quincey Morris quinceymor...@earthlink.net said: The other question that comes to mind here is: why Core Data? Core Data may simplify your life if you have a very complicated (database- ish) data model, or if you have very many (tens of thousands) data model

Re: GetProcessBundleLocation() -- no good in background agents!

2009-03-27 Thread Jerry Krinock
On 2009 Mar 25, at 16:24, Eric Schlegel wrote: This sounds like a bug to me. Please file it. Bug ID: 6731996 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the

Un-deleting objects in an NSManagedObjectContext?

2009-03-27 Thread Nick Zitzmann
I've tried reading TFM and searching TFW, but can't find a solution to a little problem. I just noticed that, if -[NSManagedObjectContext save:] fails due to a delete operation failing to validate, then the object to delete remains in the deletedObjects set. How do I get it out of that set

Can NSTrackingArea rects be nested?

2009-03-27 Thread Stuart Malin
I have a view that contains an NSTextView. I place NSTrackingAreas on portions of the TextView's text. I attach a userInfo dictionary to each of the tracking areas with a variety of parameters. The view containing the TextView happens also to have an NSTrackingArea around its entire frame.

Fwd: Help with implementing delegates

2009-03-27 Thread albert jordan Mobility
I am having problems with implementing delegates, and I'm sure I'm doing something silly. Would appreciate help from the experts. I can get a simple case to work, where I invoke a delegate method with no parameters passed, but I can't get the case where I invoke the delegate

Popup menu in custom view ...

2009-03-27 Thread Mic Pringle
Hi, I need help with implementing a popup menu in a custom view. I have an NSCollectionView, and the prototype view draws an image, some text etc. When the mouse is over the image a small bezel appears with a gear icon on it (in a similar fashion to how the 'play' bezel appears in iTunes when

Re: Popup menu in custom view ...

2009-03-27 Thread Graham Cox
On 28/03/2009, at 11:46 AM, Mic Pringle wrote: call [NSMenu popupContextMenu...] That should work, but watch the coordinates for its position - they need to be converted to screen (global) coordinates. If you pass in local ones chances are the menu is appearing off-screen. --Graham

Embeded SQLite

2009-03-27 Thread Development
Ok I've got two books, and all of apple's docs and when they talk about executing a simple sql query they create this big convoluted method to do a simple task... Is there a reason to do it that way rather than using sqlite3_exec() and getting the data via the callback? Basically I've

open URL in default browser

2009-03-27 Thread Nathaniel Cunningham
Greetings, I'm new to Cocoa, and helping to port a carbon app to cocoa. In particular, I want to be able to open an arbitrary URL in the default internet browser, regardless of whether the URL refers to a local file that normally opens in some other app (e.g. a jpeg image that opens in Preview),

Number of NSMetadataQuery objects limited?

2009-03-27 Thread Ilja A. Iwas
Hi, I am running into a problem with having more than 32 NSMetadataQuery objects around (started and still allocated). When I start my queries for a certain scope (in this case a directory containing 1.500 files, which has been indexed by a custom spotlight importer before), I cannot get

Re: user access privileges to plist in /library/preferences

2009-03-27 Thread Sjors van Berkel
Hi, if you save the file in ~/library/preferences/ the user will have access to the files because it is in the local user directory. Hope that helps, Sjors Op 27 mrt 2009, om 18:44 heeft m...@memo.tv m...@memo.tv het volgende geschreven: Hi, I'd like to load/save some global

Re: Help with implementing delegates

2009-03-27 Thread Drew Lawson
According to Greg Guerin: albert jordan Mobility wrote: In Foo, I have set up the following delegate method -(void) test: (dgtest *) sender:didFinish: (BOOL) complete Over-colonization? Try: -(void) test: (dgtest *) sender didFinish: (BOOL) complete Note the removal of the

Re: Help with implementing delegates

2009-03-27 Thread Andy Lee
On Mar 27, 2009, at 7:48 PM, Drew Lawson wrote: According to Greg Guerin: albert jordan Mobility wrote: In Foo, I have set up the following delegate method -(void) test: (dgtest *) sender:didFinish: (BOOL) complete [...] You just gave me a newbie headache. How is that original parsed?

Re: Help with implementing delegates

2009-03-27 Thread Shawn Erickson
On Fri, Mar 27, 2009 at 4:48 PM, Drew Lawson d...@furrfu.com wrote: According to Greg Guerin: albert jordan Mobility wrote: In Foo, I have set up the following delegate method -(void) test: (dgtest *) sender:didFinish: (BOOL) complete Over-colonization?  Try:    -(void) test: (dgtest

Re: Can NSTrackingArea rects be nested?

2009-03-27 Thread Quincey Morris
On Mar 27, 2009, at 15:48, Stuart Malin wrote: I have a view that contains an NSTextView. I place NSTrackingAreas on portions of the TextView's text. I attach a userInfo dictionary to each of the tracking areas with a variety of parameters. The view containing the TextView happens also to

Storing API keys in plist file

2009-03-27 Thread Devraj Mukherjee
Hi all, My app relies on an external RESTful services, the service issues a key for the REST services and at the moment I have hard coded that in my wrapper classes. I would like to put this into a preference file somewhere (suspecting a plist file). Obvious App-Info.plist doesn't seem to be

Re: Storing API keys in plist file

2009-03-27 Thread Kiel Gillard
[NSUserDefaults standardUserDefaults] Kiel :-) Love does not consist in gazing at each other but looking together in the same direction. Antoine de Saint-Exupery On 28/03/2009, at 2:38 PM, Devraj Mukherjee wrote: Hi all, My app relies on an external RESTful services, the service issues a

NSSlider with mouseUp

2009-03-27 Thread K. Darcy Otto
I have a preferences window with an NSSlider control in it that has to update continuously in order to indicate just where the marker is on the scale. But, because of the relatively complex changes required when the slider is set, I only want to act on the slider settings when the slider

Re: NSSlider with mouseUp

2009-03-27 Thread Quincey Morris
On Mar 27, 2009, at 21:39, K. Darcy Otto wrote: I have a preferences window with an NSSlider control in it that has to update continuously in order to indicate just where the marker is on the scale. But, because of the relatively complex changes required when the slider is set, I only

re: Optimistic locking failure with NSOverwriteMergePolicy

2009-03-27 Thread Ben Trumbull
Does any know how is it possible to receive optimistic locking failure exception with NSOverwriteMergePolicy in all used managed object contexts? No, that sounds like a bug, which you should file. Try using the NSMergeByPropertyObjectTrumpMergePolicy instead. - Ben

re: Un-deleting objects in an NSManagedObjectContext?

2009-03-27 Thread Ben Trumbull
-insertObject: is the reciprocal of deleteObject: You can use it to cancel a deletion. - Ben ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at