Hotkeys Query

2008-09-30 Thread Srinivasa Prabhu
Hi all, We are developing a productivity tool that has to run on both Leopard and Tiger. We want to support hotkeys for some of the functionalities. Some of the hotkeys are the same as the one registered by the default system. 'Cmd+Shift+3' , 'Cmd+Shift+4' are some of them. We are curren

Re: How to count composed characters in NSString?

2008-09-30 Thread David Niemeijer
Hi Peter, On Sep 30, 2008, at 7:58 AM, Peter Edberg wrote: CFStringGetRangeOfComposedCharactersAtIndex and -[NSString rangeOfComposedCharacterSequenceAtIndex:] are the modern replacements for UCFindTextBreak with kUCTextBreakClusterMask and indeed they now are closer to the original intent

ld: duplicate symbol

2008-09-30 Thread Claus Atzenbeck
Hi all, I have a project that compiled with XCode 2. After upgrading to XCode 3 (if I recall correctly), I get the following error: ~~ Building target “Socs” of project “Socs_project” with configuration “Debug” — (1 error) [...] ld: duplicate sy

re: NSManagedObject subclass accessor pattern mystery?

2008-09-30 Thread Ben Trumbull
So I have a CoreData app (10.5.5, 64 bit only) that has a NSManagedObject that has an NSColor* that is part of its data model. Because this color is actually a computed value that we want to cache, it is declared as a property: @property (retain) NSColor* color; but since we may need to calcula

[Math] sin(), cos() not working? What special magic must I use to summon their powers?

2008-09-30 Thread Michael Robinson
Hello, I am trying to convert the following from Javascript to Cocoa ObjC: var retVal = Math.round(cornerSize*(1-Math.cos(Math.asin(i/ cornerSize; return retVal; Now retVal _must_ be an int, because the value is used as a margin attribute ("rounding" corners of divs). This is what I'

Re: [Math] sin(), cos() not working? What special magic must I use to summon their powers?

2008-09-30 Thread Memo Akten
I'm guessing cornerSize is an int? so i/cornerSize will always return 0, so asin(i/cornerSize) will always return 0 so cos(asin(i/cornerSize)) will always return 1 so (1- cos(asin(i/cornerSize))) will always return 0 you want to do i/(float) cornerSize -

Re: [Math] sin(), cos() not working? What special magic must I use to summon their powers?

2008-09-30 Thread Jason Coco
On Sep 30, 2008, at 07:29 , Michael Robinson wrote: Hello, I am trying to convert the following from Javascript to Cocoa ObjC: var retVal = Math.round(cornerSize*(1-Math.cos(Math.asin(i/ cornerSize; return retVal; Now retVal _must_ be an int, because the value is used as a margin at

Re: [Math] sin(), cos() not working? What special magic must I use to summon their powers?

2008-09-30 Thread Graham Cox
On 30 Sep 2008, at 9:29 pm, Michael Robinson wrote: Variables i, cornerSize are passed to the function from a for loop. i being the counter for the loop, cornerSize being the size of corner desired by the user. float retVal; retVal = cornerSize*(1-cos(asin(i/cornerSize)))

Re: [Math] sin(), cos() not working? What special magic must I use to summon their powers?

2008-09-30 Thread Manfred Schwind
I think there is more than one problem here. You may want to get a good book about the C language (Obj-C is just a superset of C). Variables i, cornerSize are passed to the function from a for loop. i being the counter for the loop, cornerSize being the size of corner desired by the user.

Re: [Math] sin(), cos() not working? What special magic must I use to summon their powers?

2008-09-30 Thread Michael Robinson
Thanks for your incredibly swift replies! changing "float retVal" to "double retVal", using "return lround(retVal);" and casting ints as doubles in the formula gave me some real values, which is wonderful! I could have saved myself two hours by asking the list when I first ran into this p

To determine if the application is running from a network volume?

2008-09-30 Thread Nethan Aryan
Need Help... I have written a helper tool in Cocoa, which other than it's main task, performs a file permission change operation on the parent application folder. This tool is invoked by the parent application via a menu item. I don't want this tool to work in case the user is running the paren

Re: ld: duplicate symbol

2008-09-30 Thread Nick Zitzmann
On Sep 30, 2008, at 3:07 AM, Claus Atzenbeck wrote: CAPersonSwitchKey is defined in CAActionsController.m and appears exclusively in this particular class. CAActionsController.h is imported (#import) in CASocsController.m and CASocsView.m. I saw that quite some other people had this proble

Re: [Math] sin(), cos() not working? What special magic must I use to summon their powers?

2008-09-30 Thread Alastair Houghton
On 30 Sep 2008, at 12:59, Michael Robinson wrote: Thanks for your incredibly swift replies! changing "float retVal" to "double retVal", using "return lround(retVal);" and casting ints as doubles in the formula gave me some real values, which is wonderful! I could have saved myself two hou

Re: [Math] sin(), cos() not working? What special magic must I use to summon their powers?

2008-09-30 Thread Graff
On Oct 1, 2008, at 12:29 AM, Michael Robinson wrote: sin(90); returns 0 as well. When I use Apple's Calculator and ask it to tell me the result of sin(90), it gives me 1. The C function sin() takes radians as its parameter. In order to use degrees you need to multiply by M_PI and divide by

Re: NSManagedObject subclass accessor pattern mystery?

2008-09-30 Thread Michael B Johnson
Thanks for all the insight. A few questions: On Sep 30, 2008, at 3:08 AM, Ben Trumbull wrote: So I have a CoreData app (10.5.5, 64 bit only) that has a NSManagedObject that has an NSColor* that is part of its data model. Because this color is actually a computed value that we want to cache,

Re: problems in runModal in NSOpenPanel used with defaults

2008-09-30 Thread Corbin Dunn
On Sep 29, 2008, at 11:20 PM, spartan g wrote: Oh Yes... Thanks Mike. I got your point corbin. I was thinking that I am messing somewhere in using the panel properties!!! In fact that behavior, now, seems very helpful to get the last opened directory.. I should also mention that you shou

Re: NSLevelIndicator - setEnabled not respected

2008-09-30 Thread Benjamin Stiglitz
I've googled for over a week, and I can't find out what I'm missing here. See the AppKit release notes for 10.5 at In short, the enabled property only works if you link your app against 10.5+. -Ben

Re: Finding other apps' paths - deterministically!

2008-09-30 Thread Jerry Krinock
Michael Ash wrote: For the original problem, I'd recommend using something like LSCopyApplicationURLsForURL() if it's at all possible. Good idea but I'm looking for a helper app which is not registered to open any URLs. Also, I don't see any indication that LSCopyApplicationURLsForURL() w

Re: To determine if the application is running from a network volume?

2008-09-30 Thread Stéphane Sudre
On Sep 30, 2008, at 2:20 PM, Nethan Aryan wrote: Need Help... I have written a helper tool in Cocoa, which other than it's main task, performs a file permission change operation on the parent application folder. This tool is invoked by the parent application via a menu item. I don't want

Re: Collections can be simple Attributes in Core Data

2008-09-30 Thread Jerry Krinock
On 2008 Sep, 25, at 18:08, Jerry Krinock wrote: I'm surprised that I've never seen this discussed or documented. Is this going to get me into any trouble? Conclusion So far I haven't seen any trouble, but some quick tests indicate that when subsequently invoking -[NSManagedObjectContext

Re: Questions on An NSOpenGL Application Design

2008-09-30 Thread Matt Long
Carmen, I don't know anything about reading pixels back from VRAM and this CPU analysis you refer to. Why do you need to do that again? You might want to look into using Core Animation for what you are trying to do. For that matter, you could very easily create a simple Quartz Composition

Re: Collections can be simple Attributes in Core Data

2008-09-30 Thread I. Savant
On Mon, Sep 29, 2008 at 3:03 AM, Negm-Awad Amin <[EMAIL PROTECTED]> wrote: >> But now I find there is an even more natural way, which is to just leave >> them as a set or array, and store in an attribute of type Transformable. >> The default transformer en/decodes the collection into/from an NSDa

Re: Drawing in a window with rounded corners

2008-09-30 Thread Greg Best
Without knowing much about what you're trying to do, two thoughts come to mind: make your view rectangle smaller than the window frame, or make the background of your content transparent. I don't know much of Core Animation, so to the extent that CA is causing your problem I'm useless to yo

Re: ld: duplicate symbol

2008-09-30 Thread Claus Atzenbeck
On Tue, 30 Sep 2008, Nick Zitzmann wrote: How have you declared CAPersonSwitchKey in the header file? int CAPersonSwitchKey = 0; Making this static solved the problem. Thanks for the pointer. Claus ___ Cocoa-dev mailing list (Cocoa-dev@lists.appl

Property attributes

2008-09-30 Thread D.K. Johnston
Am I right in assuming that property attributes like "assign" and "nonatomic" have no effect for types like NSInteger and BOOL? i.e. @property NSInteger myInteger; is exactly the same as: @property(assign,nonatomic) NSInteger myInteger; dkj __

Re: NSWindow animationResizeTime

2008-09-30 Thread Colin Barrett
On Mon, Sep 29, 2008 at 9:53 AM, Ken Orr <[EMAIL PROTECTED]> wrote: > Is there any way to alter the value provided by animationResizeTime > without subclassing NSWindow (as the documentation suggests)? I assume you're trying to resize a window with an animation, right? Try using NSViewAnimation on

Re: NSWindowController retain count confusion

2008-09-30 Thread James Walker
Jonathan Hess wrote: The method -[NSObject retainCount] only exists to aid in debugging. You shouldn't be making any runtime decisions based on the return value of retainCount. You should only release something you previously retained/alloced/newed/copied or are for some other reason explicitl

Re: ld: duplicate symbol

2008-09-30 Thread Nick Zitzmann
On Sep 30, 2008, at 12:21 PM, Claus Atzenbeck wrote: int CAPersonSwitchKey = 0; Making this static solved the problem. Usually the way you do this is to declare it as an extern in the headers, then give it a concrete definition in the source somewhere. Nick Zitzmann

Problems with loose ViewController coupling and KVO to-many relationships

2008-09-30 Thread Jonathan del Strother
Heya I'm struggling a bit with NSViewControllers. My app displays a list of widgets. I have a Widget model, a WidgetView view (an NSView subclass), and a WidgetViewController (an NSViewController subclass). All of those have a one-to-one mapping - for any given WidgetViewController, it has a repr

Re: Drawing in a window with rounded corners

2008-09-30 Thread Michael Ash
On Mon, Sep 29, 2008 at 7:21 PM, Daniel Weber <[EMAIL PROTECTED]> wrote: > Hi, I have a custom view that takes up the whole frame of my textured > window. Normally, the corners of a textured window are rounded. However, > since my custom view is rectangular, it draws over the rounded corners. I am

Re: Finding other apps' paths - deterministically!

2008-09-30 Thread Michael Ash
On Tue, Sep 30, 2008 at 1:00 PM, Jerry Krinock <[EMAIL PROTECTED]> wrote: > Michael Ash wrote: > >> For the original problem, I'd recommend using something like >> LSCopyApplicationURLsForURL() if it's at all possible. > > Good idea but I'm looking for a helper app which is not registered to open >

Re: Property attributes

2008-09-30 Thread Bill Bumgarner
On Sep 29, 2008, at 10:15 PM, D.K. Johnston wrote: Am I right in assuming that property attributes like "assign" and "nonatomic" have no effect for types like NSInteger and BOOL? i.e. @property NSInteger myInteger; is exactly the same as: @property(assign,nonatomic) NSInteger

Release build wrong executable name, but debug build it correct

2008-09-30 Thread David
I changed my applciation name after I created my XCode project. I was able to change the appropriate values to get the build to generate the correct new name for the executable. Except that it only does it for a debug build. For the release build it reverted back to the old name. What gives? I ca

Re: ld: duplicate symbol

2008-09-30 Thread Bill Bumgarner
On Sep 30, 2008, at 11:21 AM, Claus Atzenbeck wrote: On Tue, 30 Sep 2008, Nick Zitzmann wrote: How have you declared CAPersonSwitchKey in the header file? int CAPersonSwitchKey = 0; Making this static solved the problem. Solved which problem? Making your code compile or making it work? Dec

Re: Release build wrong executable name, but debug build it correct

2008-09-30 Thread Nick Zitzmann
On Sep 30, 2008, at 2:02 PM, David wrote: Except that it only does it for a debug build. For the release build it reverted back to the old name. What gives? I can't figure out why its doing this. Are you sure you have your product name in sync across configurations? In the target's build

Re: NSLevelIndicator - setEnabled not respected

2008-09-30 Thread Ken Ferry
On Tue, Sep 30, 2008 at 8:57 AM, Benjamin Stiglitz <[EMAIL PROTECTED]> wrote: >> I've googled for over a week, and I can't find out what I'm missing here. > > See the AppKit release notes for 10.5 at > > > In short, the enabled property on

Re: NSManagedObject subclass accessor pattern mystery?

2008-09-30 Thread Ben Trumbull
On Sep 30, 2008, at 8:38 AM, Michael B Johnson wrote: Thanks for all the insight. A few questions: On Sep 30, 2008, at 3:08 AM, Ben Trumbull wrote: So I have a CoreData app (10.5.5, 64 bit only) that has a NSManagedObject that has an NSColor* that is part of its data model. Because this co

Re: NSLevelIndicator - setEnabled not respected

2008-09-30 Thread Ken Ferry
On Tue, Sep 30, 2008 at 1:16 PM, Ken Ferry <[EMAIL PROTECTED]> wrote: > On Tue, Sep 30, 2008 at 8:57 AM, Benjamin Stiglitz <[EMAIL PROTECTED]> wrote: >>> I've googled for over a week, and I can't find out what I'm missing here. >> >> See the AppKit release notes for 10.5 at >>

Re: Release build wrong executable name, but debug build it correct

2008-09-30 Thread Mark Dawson
On Tuesday, September 30, 2008, at 01:09PM, "Nick Zitzmann" <[EMAIL PROTECTED]> wrote: > >On Sep 30, 2008, at 2:02 PM, David wrote: > >> Except that it only does it for a debug build. For the release build >> it reverted back to the old name. >> >> What gives? I can't figure out why its doing th

Re: Release build wrong executable name, but debug build it correct

2008-09-30 Thread David
I was looking under the project properties not under target properties. Product name was set to the old value. Thanks! On Tue, Sep 30, 2008 at 5:16 PM, Mark Dawson <[EMAIL PROTECTED]> wrote: > > On Tuesday, September 30, 2008, at 01:09PM, "Nick Zitzmann" <[EMAIL > PROTECTED]> wrote: >> >>On Sep

Core Data: Copying and pasting chained entities

2008-09-30 Thread Renaud Céroce
Hi everyone, I was not able to find any answer either on this list or on the web although I thought it must be a common interrogation (my question must then be very silly, I suppose). My program uses Core Data to maintain Figures. - A Figure has a FillStyle. - A FillStyle has a FillColor (or ha

re: NSManagedObject custom class & for loop

2008-09-30 Thread HAMILTON, Steven
Great stuff. Thanks a lot, that works a treat. Feed: Cocoa mail archive Posted on: Monday, 29 September 2008 8:22 PM Author: Steven Hamilton Subject: NSManagedObject custom class & for loop > The problem is when the code hits the for (transaction in > transactions) loop it dumps to GDB with an ob

Cocoa and MySQL

2008-09-30 Thread J. Todd Slack
Hi All, Working with app that I use NSTask to execute some MySQL statements. I want to deploy the client to start testing, but I am not sure to deploy to them in the MySQL Sense. I dont quite recall what I did for MySQL on my machine. I want to create a package installer that puts the mysq

Re: [Math] sin(), cos() not working? What special magic must I use to summon their powers?

2008-09-30 Thread Michael Robinson
On 1/10/2008, at 3:23 AM, Alastair Houghton wrote: On 30 Sep 2008, at 12:59, Michael Robinson wrote: Thanks for your incredibly swift replies! changing "float retVal" to "double retVal", using "return lround(retVal);" and casting ints as doubles in the formula gave me some real values, wh

Re: Finding other apps' paths - deterministically!

2008-09-30 Thread Charles Srstka
On Sep 30, 2008, at 12:00 PM, Jerry Krinock wrote: Also, it seems to not find helper applications which are inside other applications' packages. Is there any reason why you couldn't just search for the main application which contains the helper application inside its bundle and then just

Re: [Math] sin(), cos() not working? What special magic must I use to summon their powers?

2008-09-30 Thread Andrew Farmer
On 30 Sep 08, at 16:43, Michael Robinson wrote: retVal = lround(size*(1-cos(asin((double)i/(double)size; if(retVal > 0 ) return retVal; Note that cos(asin(x)) = sqrt(1-x*x). HTH. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: Cocoa and MySQL

2008-09-30 Thread Nick Zitzmann
On Sep 30, 2008, at 5:27 PM, J. Todd Slack wrote: Working with app that I use NSTask to execute some MySQL statements. Why aren't you using the library directly or via ODBC? NSTask is usually reserved for things that can't be done (easily) within libraries. Can anyone tell me what to de

Re: NSWindowController retain count confusion

2008-09-30 Thread Jonathan Hess
On Sep 30, 2008, at 12:01 PM, James Walker wrote: Jonathan Hess wrote: The method -[NSObject retainCount] only exists to aid in debugging. You shouldn't be making any runtime decisions based on the return value of retainCount. You should only release something you previously retained/all

Re: NSWindowController retain count confusion

2008-09-30 Thread James Walker
Jonathan Hess wrote: On Sep 30, 2008, at 12:01 PM, James Walker wrote: However, I did solve my problem. I neglected to mention that I'm working in a mostly Carbon app. When I surrounded the alloc, init, and showWindow calls with a local autorelease pool, the problem went away and the NSWin

Re: NSWindowController retain count confusion

2008-09-30 Thread James Walker
Patrick Mau wrote: On 30.09.2008, at 04:30, James Walker wrote: I have an NSWindowController subclass that is defined as File's Owner in a nib. The window outlet is connected to a window, and the delegate outlet of the window goes back to the File's Owner. I was trying to release the control

Adding a new menu programmatically

2008-09-30 Thread Matthew Gertner
Hi, I'm trying to add a new menu to the main menu of my application using Cocoa. I thought something like this would do the trick: NSMenu* menu = [[NSMenu alloc] initWithTitle:@"foo"]; NSMenuItem* item = [[NSApp mainMenu] addItemWithTitle:@"foo" action: nil keyEquivalent: @""];

Re: Adding a new menu programmatically

2008-09-30 Thread Colin Barrett
On Tue, Sep 30, 2008 at 1:20 PM, Matthew Gertner <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to add a new menu to the main menu of my application using > Cocoa. I thought something like this would do the trick: > > NSMenu* menu = [[NSMenu alloc] initWithTitle:@"foo"]; > NSMenuItem* item = [[N

Re: Adding a new menu programmatically

2008-09-30 Thread Jason Coco
On Sep 30, 2008, at 16:20 , Matthew Gertner wrote: Hi, I'm trying to add a new menu to the main menu of my application using Cocoa. I thought something like this would do the trick: NSMenu* menu = [[NSMenu alloc] initWithTitle:@"foo"]; NSMenuItem* item = [[NSApp mainMenu] addItemWithTitle:@"f

Finding the iTunes Music Library

2008-09-30 Thread Mr. Gecko
Hello I am needing to know how to find the iTunes Music Library. I know people could have it in places other than ~/Music/iTunes/ because I moved mine to /Volumes/Music/ by holding down option at iTunes start. How would I determine where it is located. I looked in com.apple.iTunes.plist and

Re: Finding the iTunes Music Library

2008-09-30 Thread Colin Barrett
On Tue, Sep 30, 2008 at 8:20 PM, Mr. Gecko <[EMAIL PROTECTED]> wrote: > Hello I am needing to know how to find the iTunes Music Library. Check out the iMedia Library from Karelia. http://www.karelia.com/imedia/ -Colin ___ Cocoa-dev mailing list (Cocoa-

Re: Finding the iTunes Music Library

2008-09-30 Thread Colin Barrett
On Tue, Sep 30, 2008 at 8:26 PM, Colin Barrett <[EMAIL PROTECTED]> wrote: > On Tue, Sep 30, 2008 at 8:20 PM, Mr. Gecko <[EMAIL PROTECTED]> wrote: >> Hello I am needing to know how to find the iTunes Music Library. > > Check out the iMedia Library from Karelia. http://www.karelia.com/imedia/ Sorry,

Re: Finding the iTunes Music Library

2008-09-30 Thread Mr. Gecko
Thanks I'll look into that. On Sep 30, 2008, at 10:28 PM, Colin Barrett wrote: On Tue, Sep 30, 2008 at 8:26 PM, Colin Barrett <[EMAIL PROTECTED]> wrote: On Tue, Sep 30, 2008 at 8:20 PM, Mr. Gecko <[EMAIL PROTECTED]> wrote: Hello I am needing to know how to find the iTunes Music Library. Ch

PubSub not downloading image enclosures automatically.

2008-09-30 Thread Colin Barrett
PubSub does not seem to be downloading image enclosures automatically. I'm pretty sure it's not just that the delegate methods that aren't getting called, since I checked the PubSub sqlite DB and from what I could tell no files were downloaded. Any suggestions? Or is PubSub just broken... in which

[MEET] CocoaHeads Mac Developer Meetings

2008-09-30 Thread Stephen Zyszkiewicz
Greetings, CocoaHeads is an international Mac programmer's group. We specialize in Cocoa, but everything Mac programming related is welcome. Why Should I Attend? Meeting other Mac OS X developers in person is both fun and immensely useful. There's no better way to learn Cocoa or get help with p

Re: ld: duplicate symbol

2008-09-30 Thread Claus Atzenbeck
On Tue, 30 Sep 2008, Bill Bumgarner wrote: Solved which problem? Making your code compile or making it work? In this particular case, it would compile and work. However, I see the problem. I declared the variable as extern, as suggested by Nick. This makes more sense. Thanks, also to Nick