Re: Getting all subclasses

2008-06-18 Thread Jean-Daniel Dupas
IIRC, +initialize call the super implementation if the child class does not override it, but not the +load method that is called exactly once per class and per categorie. So +load will not be called automatically. Le 18 juin 08 à 18:57, Mike Abdullah a écrit : Another option would be to w

Re: Converting HID keyboards usages to characters ?

2008-06-19 Thread Jean-Daniel Dupas
Le 19 juin 08 à 10:32, Fred Leboucher a écrit : Hi, I'm trying to do something that was discussed before in the Carbon lists : convert a HID keyboard usage to a unicode character, with the current modifier keys applied, and using the system-wide selected keyboard layout. This technical n

Re: Cocoa can be used to execute arbitrary (privileged) code !

2008-06-19 Thread Jean-Daniel Dupas
That's why you should basically never link on high-level framework with a setuid tools. Le 19 juin 08 à 20:48, Charles Steinman a écrit : This is in fact a Cocoa vulnerability, so it seems relevant to this list. All Cocoa applications automagically come with rudimentary AppleScript suppor

Re: install_name_tool

2008-06-19 Thread Jean-Daniel Dupas
Le 19 juin 08 à 23:02, Kyle Sluder a écrit : On Thu, Jun 19, 2008 at 4:40 PM, Martin <[EMAIL PROTECTED]> wrote: And as you can see, nothing has changed and the first line has certainly not been replaced by "bla". What am I doing wrong? Shouldn't you be using the -id flag, not -change? --

Re: install_name_tool

2008-06-20 Thread Jean-Daniel Dupas
You don't want to change the path, you want to change the id of your library. -change is intended to be used to change the path of a dependent library in an other binary. install_name_tool -id @executable_path../../Frameworks/Foo.framework/ Versions/A/Foo Foo.framework/Foo But as I said,

Re: Cocoa can be used to execute arbitrary (privileged) code !

2008-06-20 Thread Jean-Daniel Dupas
Le 20 juin 08 à 06:09, Ken Thomases a écrit : On Jun 19, 2008, at 10:39 PM, Jens Alfke wrote: It might not be a bad idea to proactively disarm this vulnerability on your own machine(s), as I just did: sudo chmod -s System/Library/CoreServices/RemoteManagement/ ARDAgent.app/ARDAgent Tha

Re: Interesting Problem Code worked in 10.4 but not in 10.5

2008-06-22 Thread Jean-Daniel Dupas
Launch it with the debugger and check the stack when it crash. Without any hint about the stack, we cannot really help you, but just give you some guess. Le 22 juin 08 à 23:26, Clayton Leitch a écrit : See code below. Get a error of “EXC_BAD_ACCESS” when I make entries in the GUI. Code us

Re: iCal server Cocoa API?

2008-06-23 Thread Jean-Daniel Dupas
Le 23 juin 08 à 13:37, Devraj Mukherjee a écrit : Hi everyone, I wondering if OSX Server components like iCal server or Address Book server (which I assume is LDAP based) have Cocoa libraries to populate/query data. I am trying to construct a Cocoa application but wish to re-use as much of App

Re: Seconds since system startup

2008-06-24 Thread Jean-Daniel Dupas
Wow, that one of the more complexe way i see to retreive it. The former equivalent of GetCurrentEventTime() is -[NSEvent timestamp]. But if you need the uptime without using an event, you can use mach_absolute_time() or UpTime() (from the CoreServices framework). Le 24 juin 08 à 15:00, Chri

Re: Seconds since system startup

2008-06-24 Thread Jean-Daniel Dupas
Sorry, it look easy with sysctl too. That just that I had some bad experiences with sysctl to retreive some poorely documented values and structs. Le 24 juin 08 à 15:07, Jean-Daniel Dupas a écrit : Wow, that one of the more complexe way i see to retreive it. The former equivalent of

Re: Get the UUID of the current user

2008-06-25 Thread Jean-Daniel Dupas
#include uuid_t uuid; mbr_uid_to_uuid(getuid(), uuid); See "man mbr_uid_to_uuid" for details. Or if you target 10.5 only, that maybe possible using the new Identity API ( http://developer.apple.com/documentation/Networking/Reference/IdentityServices_RefCollection/index.html ) Le 25 jui

Re: Get the UUID of the current user

2008-06-25 Thread Jean-Daniel Dupas
Probably a private function. Anyway, not really hard to implement: #include mbr_user_name_to_uuid(const char *username, uuid_t uuid) { struct passwd *info = getpwnam(username); if (info) mbr_uid_to_uuid(info->pw_uid, uuid); } Le 25 juin 08 à 13:38, Yoann GINI a écrit : A friend have

Re: Where can I get some examples of if() conditionals being used with string variables in Objective-C

2008-06-25 Thread Jean-Daniel Dupas
Le 25 juin 08 à 14:24, Papa-Raboon a écrit : Hi All, Anybody know where can I get some examples of if() conditionals being used with string variables in Objective-C? To be specific, I am trying to use an if conditional to check the value of a string being a certain value and then replacin

Re: NSWindow setIgnoresMouseEvents and Spaces

2008-06-26 Thread Jean-Daniel Dupas
Le 26 juin 08 à 11:26, Stefano Pigozzi a écrit : Hello, I'm modding Apple's RoundTransparentWindow sample in order to draw a gradient overlay on all the screen (to fix the non uniform lighting on my iMac's screen). The applicazion works quite nicely but when I'm switching to another sp

Re: __CGEvent structure

2008-06-26 Thread Jean-Daniel Dupas
Le 26 juin 08 à 14:53, Stefan Hafeneger a écrit : Hi, I would like to know how the __CGEvent (CGEventRef) struct is defined, so if there is any possibility to attach some more data to an low level event than through the functions defined CGEvent.h. Any ideas? With best wishes, Stefan

Re: What does 'thread safe' mean?

2008-06-27 Thread Jean-Daniel Dupas
Le 27 juin 08 à 10:02, Uli Kusterer a écrit : Am 27.06.2008 um 09:27 schrieb Omar Qazi: On Jun 26, 2008, at 11:50 PM, Kevin Ferguson wrote: I am not entirely sure as to what exactly a thread is, but seeing as anything I've ever programmed is light weight, I've never needed to worry before

Re: Clock-like looping

2008-06-29 Thread Jean-Daniel Dupas
the '%' operator cannot be used with floating point values, but it works well with integer: => (11 + 2) % 12 = 1 Le 29 juin 08 à 19:34, Daniel Richman a écrit : Use double newNumber = oldNumber % 13; This will return your number's remainder when dividing between 13, which could be 0 - 1

Re: Creating AppControllers in InterfaceBuilder 3.1

2008-06-30 Thread Jean-Daniel Dupas
Le 30 juin 08 à 16:20, Tommy Nordgren a écrit : On 30 jun 2008, at 16.14, [EMAIL PROTECTED] wrote: Hi I'm writing my first project in Leopard and can't figure out how to accomplish the old "Subclass NSObject/Generate Files/Instantiate" series of steps in Interface Builder 3.1. I'm sur

Re: Process app.

2008-06-30 Thread Jean-Daniel Dupas
Le 30 juin 08 à 17:27, Jens Alfke a écrit : On 30 Jun '08, at 6:23 AM, Толя Макаров wrote: Yes, that's clear, but how to get this list? I have found 2 ways: ps -ef and [[NSWorkspace sharedWorkspace] launchedApplications]. There are underlying APIs that tools like ps and top use; you can

Re: garbage collection and NSConnection

2008-06-30 Thread Jean-Daniel Dupas
Le 30 juin 08 à 22:10, eblu a écrit : Hi Chris, I'm not terribly sure what you are asking for here. From my experience (limited experience admittedly) theres really only one way to use NSConnection. its a pretty elegant class, which is simple, and works as expected, except for when garbag

Re: garbage collection and NSConnection

2008-06-30 Thread Jean-Daniel Dupas
Le 30 juin 08 à 22:19, Jean-Daniel Dupas a écrit : Le 30 juin 08 à 22:10, eblu a écrit : Hi Chris, I'm not terribly sure what you are asking for here. From my experience (limited experience admittedly) theres really only one way to use NSConnection. its a pretty elegant class, whi

Re: Linking against /Dev/L/PrivateFrameworks/

2008-06-30 Thread Jean-Daniel Dupas
Le 30 juin 08 à 23:10, Owen Yamauchi a écrit : Yes, I know, I shouldn't be linking against an Apple private framework, but trust me, there's a reason for it. Anyway, I'm having trouble building the project. I dragged my private framework (DevToolsCore.framework) into Xcode and left all the def

Re: Process app.

2008-07-01 Thread Jean-Daniel Dupas
Le 1 juil. 08 à 10:28, Толя Макаров a écrit : dreamcat7 The process loginwindow is not shown In the list that is given by the function sysctl. May be this process has another name. Do you know anything about it? Makarov Anatolii Just curious about it. Why do you need to listen loginwi

Re: Process app.

2008-07-01 Thread Jean-Daniel Dupas
Le 1 juil. 08 à 11:24, Толя Макаров a écrit : Jean-Daniel Dupas. I want to know if loginwindow.app is started up at the moment, after this my program enters a password. Sometimes I enter password myself and my program should know that loginwindow.app has finished its work. Makarov

Re: Process app.

2008-07-01 Thread Jean-Daniel Dupas
documented way to do it. Le 1 juil. 08 à 12:20, Толя Макаров a écrit : Thanks for the example. But GetBSDProcessList shows in the list "loginwindow", when it's on and doesn't work. The same works ps -ef. - Исходное сообщение От: Jean-Daniel Dupas <[EM

Re: class keeps track of object

2008-07-01 Thread Jean-Daniel Dupas
search for singleton pattern (in the archives and in Apple doc too). The simplest way to do it is (not thread safe): @implementation Foo + (Bar *)sharedFoo { static Foo *shardInstance = nil; if (!sharedInstance) sharedInstance = [[Foo alloc] init]; return sharedInstance; } @end Le 2

Re: Best way to handle background i/o and notify main UI thread

2008-07-01 Thread Jean-Daniel Dupas
Le 2 juil. 08 à 01:24, Chris Irvine a écrit : On Jul 1, 2008, at 3:17 PM, Douglas Davidson wrote: On Jul 1, 2008, at 3:11 PM, Chris Irvine wrote: I've been doing a lot of reading about this, but I still don't feel like I have a concise answer. I'm building a small suite of applications

Re: exec(uting) Safari - How (newbie)

2008-07-02 Thread Jean-Daniel Dupas
"a lot easier than Launch Services" ? extern char **environ; char *args[] = { "-a", "Safari", NULL}; execve("/usr/bin/open", args, environ); versus: FSRef app; if (noErr == LSFindApplicationForInfo(kLSUnknownCreator, NULL, CFSTR("Safari"), &app, NULL)) LSOpenFSRef(&app, NULL); Le

Re: Process app.

2008-07-02 Thread Jean-Daniel Dupas
The login window has nothing to do with the authentification panel shown when you want to leave the screen saver. It the same panel than the one you show when you try to move a file that require authorization in the Finder, or the same than the one the installer open when it need perform so

Re: exec(uting) Safari - How (newbie)

2008-07-02 Thread Jean-Daniel Dupas
ervices. OK. In fact, I never use LS with app name but with bundle ID instead. It's far more reliable. LSFindApplicationForInfo(kLSUnknownCreator, CFSTR("com.apple.Safari"), NULL, &app, NULL) On Jul 2, 2008, at 03:30 , Jean-Daniel Dupas wrote: "a lot easier

Re: A question of style: Returning 'pairs'

2008-07-02 Thread Jean-Daniel Dupas
Le 2 juil. 08 à 20:56, Abernathy, Joshua a écrit : If it were an oft-used pair, I'd probably make a struct to hold them together, but if it's a just-this-one-method, just-this-one-time thing I'd settle with a Dictionary. Of course, you do have one more option: pass-by-reference or pointer. I'v

Re: How to converting a Carbon nib to Cocoa?

2008-07-03 Thread Jean-Daniel Dupas
Anyway, it does note make sense, as upgrading the view without rewriting all the logic using Cocoa paradigms is probably not a good idea. Unlike Carbon nib, Cocoa nib are not just a set of interface object with some property and flags, they also contains lots of information about action, ta

Re: garbage collection and NSConnection

2008-07-04 Thread Jean-Daniel Dupas
Le 4 juil. 08 à 11:25, Joan Lluch (casa) a écrit : There is a couple of points I think you are missing here. First, GC makes programs go slower not because of the overhead of the garbage collection itself, which I concede that may be comparable to the retain/release calls in a non-manag

Re: string to float

2008-07-04 Thread Jean-Daniel Dupas
Le 4 juil. 08 à 17:15, Robert Cerny a écrit : Hi folks, I made a parser, which returns values like 10,45. It means, it has comma as a decimal point delimiter, which is correct in my language. I was trying to find a way to convert to NSNumber. Is it correct the the right way is to use NSSca

Re: Using deprecated methods

2008-07-05 Thread Jean-Daniel Dupas
Le 5 juil. 08 à 14:08, Keith Blount a écrit : Hi, Something that has bothered me for ages in Cocoa, but which I've always put to one side, is how to handle certain deprecated methods when supporting more than one OS. In some instances it's as simple as checking at runtime which OS is bei

Re: Using deprecated methods

2008-07-05 Thread Jean-Daniel Dupas
Le 5 juil. 08 à 15:46, Keith Blount a écrit : Many thanks for your reply, much appreciated. Where can I find information on creating bundles and linking them only against a certain OS? I'm obviously using the wrong search terms in both the docs and in Cocoa-dev... Under the NSBundle docume

Re: Using deprecated methods

2008-07-05 Thread Jean-Daniel Dupas
Le 5 juil. 08 à 15:56, Jean-Daniel Dupas a écrit : Le 5 juil. 08 à 15:46, Keith Blount a écrit : Many thanks for your reply, much appreciated. Where can I find information on creating bundles and linking them only against a certain OS? I'm obviously using the wrong search terms in

Re: Focus Ring in NSBrowser Column

2008-07-05 Thread Jean-Daniel Dupas
Le 5 juil. 08 à 21:48, James Murdza a écrit : - (BOOL)needsDisplay; { NSResponder* resp = nil; Note that there's an extra semicolon on the first line. This is a valid syntax in Obj-C. You can let the semicolon for method implementation. smime.p7s Description: S/MIME cryptographic

Re: Capture Window/View created through NSTask

2008-07-05 Thread Jean-Daniel Dupas
Le 6 juil. 08 à 00:43, Michael Moore a écrit : I'm hoping someone might be able to assist me with this question. I have a Cocoa application, with an embedded command-line tool in the Resources folder. This tool is from an outside source, and I have no source code available for it. When launc

Re: Capture Window/View created through NSTask

2008-07-06 Thread Jean-Daniel Dupas
e the fully functional NSView displayed - so I can interact with it, etc. For example, imagine taking an OpenGL game and embedding the game in a custom nib within a custom application. On Jul 5, 2008, at 7:11 PM, Jean-Daniel Dupas wrote: Le 6 juil. 08 à 00:43, Michael Moore a écrit :

Re: Method Sees Populated Array As Empty

2008-07-06 Thread Jean-Daniel Dupas
Try NSLog(@"%@", self) and make sure your are working with the same document instance and not with two distincs documents objects (one with a full array and one with an empty array). Le 6 juil. 08 à 12:26, Mark Wales a écrit : Do you actually have an accessor method for arrayOfReferences?

Re: Method Sees Populated Array As Empty

2008-07-06 Thread Jean-Daniel Dupas
Le 6 juil. 08 à 13:47, Mark Wales a écrit : So the document instance changes I guess. Why would that happen and how can I stop it? Only your code could tell us why. The MyDocument.m file is pretty long so I don't want to post it on here, and it links to other files too. So here's the f

Re: Guidelines for Cocoa frameworks supporting garbage collection?

2008-07-06 Thread Jean-Daniel Dupas
Le 6 juil. 08 à 14:45, Bill Cheeseman a écrit : on 2008-07-06 2:45 AM, Quincey Morris at [EMAIL PROTECTED] wrote: It also occurs to me that the OP is going to have to be careful to document the behavior of methods in *his* framework that return new CF objects (if there are any). He'll ha

Re: Stopping actions mid stream

2008-07-06 Thread Jean-Daniel Dupas
Not only his commenters disagree. http://daringfireball.net/linked/2008/07/01/spolsky-menu-items http://www.red-sweater.com/blog/515/disabled-menus-are-usable And I disagree too. Le 6 juil. 08 à 15:41, Peter Zegelin a écrit : I agree with you but here is JoelOnSoftware saying virtually the

Re: Stopping actions mid stream

2008-07-06 Thread Jean-Daniel Dupas
I haven't test but -[NSMenuItem setToolTip:] look fine to do this. Now, just chek if this methods works even when the item is disabled. Le 6 juil. 08 à 16:31, Peter Zegelin a écrit : Some of the commenters suggest a tool tip over the disabled menu explaining why it is disabled, which sounds re

Re: Guidelines for Cocoa frameworks supporting garbage collection?

2008-07-06 Thread Jean-Daniel Dupas
Le 6 juil. 08 à 17:35, Michael Ash a écrit : On Sun, Jul 6, 2008 at 11:25 AM, Bill Cheeseman <[EMAIL PROTECTED]> wrote: on 2008-07-06 9:49 AM, Jean-Daniel Dupas at [EMAIL PROTECTED] wrote: If __strong is so dangerous, why is it used in Cocoa (see NSDrawer, NSDateFor

Re: plist parsing in c

2008-07-06 Thread Jean-Daniel Dupas
Le 6 juil. 08 à 20:44, Keith Duncan a écrit : How can you read a plist file from C? Unless you're looking for a pure C solution which isn't dependent on any Mac OS libraries, you could always use CFXMLParser and it's SAX based callbacks. If you can use CFXMLParser, you can use CFProper

Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string?

2008-07-06 Thread Jean-Daniel Dupas
Le 6 juil. 08 à 21:25, Stéphane Sudre a écrit : Problem: I would like/need to know the height that would be required to render a string inside a fixed width box. Solution that does not work: So far, I've been using a solution found from a google searc

Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string?

2008-07-07 Thread Jean-Daniel Dupas
Le 7 juil. 08 à 23:54, Stéphane Sudre a écrit : On Jul 6, 2008, at 11:26 PM, Jean-Daniel Dupas wrote: Le 6 juil. 08 à 21:25, Stéphane Sudre a écrit : Problem: I would like/need to know the height that would be required to render a string inside a fixed width box. Solution

Re: Removing folder from /Applications

2008-07-08 Thread Jean-Daniel Dupas
Le 8 juil. 08 à 21:59, Chris Hanson a écrit : On Jul 8, 2008, at 11:19 AM, Nick Zitzmann wrote: On Jul 8, 2008, at 6:20 AM, Glover,David wrote: myStatus = AuthorizationCopyRights (myAuthorizationRef, &myRights, kAuthorizationEmptyEnvironment, myFlags, NULL);

Re: Receive notifications about frontmost application change

2008-07-09 Thread Jean-Daniel Dupas
Yes, so the bad new is that you have to go Carbon to listen front switched events, the good new is that this part of Carbon is available for 64 bits apps (probably because this is the only public way to do this for now). Le 9 juil. 08 à 17:49, Matt Gough a écrit : You can do this (and a

Re: Quick look preview multipage rich text

2008-07-09 Thread Jean-Daniel Dupas
Le 9 juil. 08 à 23:54, Julien Jalon a écrit : If I understand correctly your point, it seems that in the first case, you use the direct to data print operation and in the second case, you use the direct to file print operation then read back the file in memory and send it to Quick Look. Bo

Re: Quick look preview multipage rich text

2008-07-09 Thread Jean-Daniel Dupas
Le 10 juil. 08 à 00:20, Jean-Daniel Dupas a écrit : Le 9 juil. 08 à 23:54, Julien Jalon a écrit : If I understand correctly your point, it seems that in the first case, you use the direct to data print operation and in the second case, you use the direct to file print operation then read

Re: Why can't I name a property `tag'?

2008-07-10 Thread Jean-Daniel Dupas
Le 10 juil. 08 à 16:10, I. Savant a écrit : On Thu, Jul 10, 2008 at 9:49 AM, an0 <[EMAIL PROTECTED]> wrote: Thanks. But isn't it annoying for XCode to pretend to know something for sure while in fact it is just a wrong guess? At least the warning is very misleading. How is this XCode's faul

Re: Why can't I name a property `tag'?

2008-07-10 Thread Jean-Daniel Dupas
You don't say you "my pet", you said "one of my family member's pet" I'm not wrong if I assume that it's your brother pet. Just tell the compiler it is your pet and not your brother's on and it will be happy (see the cast in the following line): filteredPosts = [[self filterPosts:postNodes

Re: Why can't I name a property `tag'?

2008-07-10 Thread Jean-Daniel Dupas
Le 10 juil. 08 à 17:52, Graham Cox a écrit : Actually it doesn't emit a warning. If you recall my problem a few weeks ago with: - (float) position; vs. - (int) position; the compiler sailed blithely on without a mention, generating code that smashed the stack to pieces. This is differe

Re: Why can't I name a property `tag'?

2008-07-10 Thread Jean-Daniel Dupas
default? What's the flag? G. On 11 Jul 2008, at 2:21 am, Jean-Daniel Dupas wrote: The compiler will not try to search any -position method in headers you do not include in your file. If you include more than one interface with different declaration it will tell you like this: w

Re: how to invoke the authentication dialog

2008-07-15 Thread Jean-Daniel Dupas
Le 15 juil. 08 à 12:14, 李国良 a écrit : maybe the system have such kind of API that used to popup dialog for authentication, i means if the user want to run an application which need the administrator access right, so this dialog popup and request the administrator's password. my question is th

Re: Move window to second display

2008-07-16 Thread Jean-Daniel Dupas
Le 16 juil. 08 à 13:01, Fabian a écrit : Hi, I only have one monitor, so I'm having a bit of a problem figuring this out. I have a (borderless) window that should be displayed on any display chosen by the user. I figured the code below would do the trick, but apparently it's a no go (I use

Re: Move window to second display

2008-07-16 Thread Jean-Daniel Dupas
Le 16 juil. 08 à 18:15, Scott Ribe a écrit : The window frame origin is a position relative to the screen origin. Try this: screenRect.origin = NSZeroPoint; [win setFrame:screenRect display:YES]; No, that will just position the window on the main screen. If the window frame origin were re

Re: the alert sheet without the application icon

2008-07-17 Thread Jean-Daniel Dupas
Le 17 juil. 08 à 10:33, 李国良 a écrit : You know, most alerts are standard alerts, they display the application icon of the current application. My question is that how to display the alert sheet without the application icon, just with some characters. Do i need to custom a sheet in Interfa

Re: NSMessagePort Invalidation

2008-07-17 Thread Jean-Daniel Dupas
Le 17 juil. 08 à 16:48, Keary Suska a écrit : 7/15/08 8:48 AM, also sprach [EMAIL PROTECTED]: NSMessagePort doesn't seem to post the NSPortDidBecomeInvalidNotification notification when the remote port dies. It doesn't seem to matter if the remote port is closed via the invalidate method or b

Re: notification when app is moved

2008-07-17 Thread Jean-Daniel Dupas
Le 17 juil. 08 à 23:03, Uli Kusterer a écrit : On 17.07.2008, at 12:50, Mitchell Livingston wrote: I need to pass the location to a c library and reset the location in this library when the application is moved, so I need a way to know when the app is moved. How can I call it again if I d

Re: notification when app is moved

2008-07-17 Thread Jean-Daniel Dupas
Le 17 juil. 08 à 23:13, Jean-Daniel Dupas a écrit : Le 17 juil. 08 à 23:03, Uli Kusterer a écrit : On 17.07.2008, at 12:50, Mitchell Livingston wrote: I need to pass the location to a c library and reset the location in this library when the application is moved, so I need a way to know

Re: Xcode style divider with embedded popup and pulldown menus

2008-07-18 Thread Jean-Daniel Dupas
Le 18 juil. 08 à 17:39, Rick Hoge a écrit : I would like to include a view divider similar to the one used in Xcode at the top of the editor window (contains forward and back buttons, popups for selection of source file and function, as well as pulldowns for a number of functions). I ex

Re: Dispatch NSEvent to everyone

2008-07-18 Thread Jean-Daniel Dupas
Le 18 juil. 08 à 17:55, Matthew Williamson a écrit : Hello list, Ok, I'm completely new to Cocoa programming, but I've been programming for 10 years, so I think I can figure this out. I'm trying to do something remotely similar to a VNC server (pun intended :-) ), but I need to be able t

Re: Did I reinvent the wheel?

2008-07-18 Thread Jean-Daniel Dupas
I don't think there is built-in support for this specific feature. If archiving, serialization and CoreData do not fit your needs, I bet you have to use your own method. That said, you should avoid to use an uninitialized variable in your code ;-) (outCount is used in array initializer before

Re: how to clear the whole render tree of CALayer fast and safely?

2008-07-19 Thread Jean-Daniel Dupas
Le 19 juil. 08 à 07:20, Cloud Strife a écrit : Hi, everyone.Assuming there is a Core Animation render tree with many calayers and complex levels, should I use the iteration function to remove one layer from one layer or there just is some useful function to delete the whole render tree nea

Re: substitute class at runtime?

2008-07-19 Thread Jean-Daniel Dupas
Le 19 juil. 08 à 08:12, Kyle Sluder a écrit : On Sat, Jul 19, 2008 at 1:10 AM, Andy Lee <[EMAIL PROTECTED]> wrote: Am I misunderstanding? No, I assure you that I'm the one who misunderstood. Although now the question is why would one use an array of strings when one could use an array of Cl

Re: How to get cursor text from a Mac window

2008-07-19 Thread Jean-Daniel Dupas
Le 19 juil. 08 à 14:00, Gang Chen a écrit : Hi, I am new to Cocoa and Mac dev, and I want to make a simple dictionary program with Cocoa on MacOSX. Can anybody help and tell me how to get any words on screen where cursor points in Cocoa? Regards, -Mike Could you not simply use the buil

Re: How to customize View to combine UITextView and UITextField?

2008-07-19 Thread Jean-Daniel Dupas
iPhone SDK -- Until an announcement is made otherwise, developers should be aware that the iPhone SDK is still under non-disclosure (section 5.3 of the iPhone Development Agreement). It can't be discussed here, or anywhere publicly. This includes other mailing lists, forums, and definitel

Re: property name-to-accessor munging? (was: Dot Syntax docs missing?)

2008-07-20 Thread Jean-Daniel Dupas
Le 20 juil. 08 à 10:33, Ken Thomases a écrit : On Jul 18, 2008, at 11:53 PM, Rick Mann wrote: I realize after all this, it's not really the Dot Syntax I need. I need to know how a property name (starts with lower-case letter) is transliterated into the getter/setter names. The dot syntax

Re: property name-to-accessor munging? (was: Dot Syntax docs missing?)

2008-07-20 Thread Jean-Daniel Dupas
Le 20 juil. 08 à 16:31, Clark Cox a écrit : On Sun, Jul 20, 2008 at 4:17 AM, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: Le 20 juil. 08 à 10:33, Ken Thomases a écrit : On Jul 18, 2008, at 11:53 PM, Rick Mann wrote: I realize after all this, it's not really the Dot Syntax I nee

Re: How to get a table column header with an image instead of text?

2008-07-20 Thread Jean-Daniel Dupas
Le 20 juil. 08 à 19:54, Marc Respass a écrit : Hi again, I hate answering my own question but I did figure it out. I sub- classed NSTableHeaderCell then created an instance using initImageCell. Then it occurred to me that it seemed a bit silly. If I can init an image cell, maybe I can jus

Re: looking for help with http post example

2008-07-20 Thread Jean-Daniel Dupas
Le 20 juil. 08 à 19:55, Richard Nichols a écrit : Hi I'm looking for a simple example that will show me how to do an http POST with user and password in cocoa. All I want to do is send some text to a php script but it expects the see the user and password and I'm not sure what classes to

Re: NSLog on releasebuild

2008-07-23 Thread Jean-Daniel Dupas
By carefull with the basename function. Theoricaly, it require a mutable string (char * and not const char *), so this logging function may crash (even it for now it works). Le 23 juil. 08 à 20:01, Nate Weaver a écrit : This is the route I follow. I use normal NSLog() statements for condit

Re: Folder has limited permissions.

2008-07-24 Thread Jean-Daniel Dupas
Le 24 juil. 08 à 14:24, Macarov Anatoli a écrit : HI! Cocoa, Obj-c. How to creat a file in the folder that has limited permissions (read- only)? Give me example, please. You can use NSTask and /usr/libexec/authopen (and pipes) See "man authopen" for details. If it's not enought, you have t

Re: Folder has limited permissions.

2008-07-24 Thread Jean-Daniel Dupas
I think Apple has one, but to find it, you may have to try to search… http://developer.apple.com/samplecode/BetterAuthorizationSample/index.html Le 24 juil. 08 à 15:37, Macarov Anatoli a écrit : Someone has an example with authorization services.Le 24 juil. 08 à 14:24, Macarov Anatoli a éc

Re: Daemon Advice?

2008-07-24 Thread Jean-Daniel Dupas
Once through your run loop is also a good place to hint to the collector that it should collect if necessary. A non-GC app would probably bracket the run of the run loop in an autorelease pool. A decent technique for this is to get the underlying CFRunLoop from the NSRunLoop (they're NO

Re: Folder has limited permissions.

2008-07-28 Thread Jean-Daniel Dupas
You have to use "create and write" (-c -w) authopen -c -w /etc/tolea.txt And also to write some data by creating an other pipe and binding it to the task's standard input (and then using fileHandleForWriting). Le 28 juil. 08 à 09:46, Macarov Anatoli a écrit : This is my code, I would give

Re: NSGraphicsContext restore crashes my xtension

2008-07-28 Thread Jean-Daniel Dupas
Le 28 juil. 08 à 10:17, Ken Tozier a écrit : On Jul 28, 2008, at 2:42 AM, Ken Ferry wrote: Graham's suggestion is also better because -[NSGraphicsContext setCurrentContext:] just releases the context that was previously current, as opposed to autoreleasing it. So this has a bug: NSGraphics

Re: Storing values in dictionary with their address as the key

2008-07-28 Thread Jean-Daniel Dupas
Le 29 juil. 08 à 00:09, Charles Steinman a écrit : --- On Mon, 7/28/08, Carter R. Harrison <[EMAIL PROTECTED]> wrote: Actually now that I'm looking at this more closely, NSDictionary is expecting an NSString for the key when inserting a value. Your example uses an NSValue for the key - the

Re: private methods and variables

2008-07-30 Thread Jean-Daniel Dupas
Le 30 juil. 08 à 11:26, Torsten Curdt a écrit : Where does it say that protocols can't include class methods? If there is documentation indicating as much then there is a bug somewhere and I'd like to know about it. The following works as expected -- the compiler complains mightily abou

Re: interrupting a thread/run loop

2008-08-01 Thread Jean-Daniel Dupas
Le 1 août 08 à 14:52, Ken Thomases a écrit : On Aug 1, 2008, at 6:43 AM, Chris Idou wrote: I have a Cocoa thread waiting on events in a run loop. But I want to be able to give the waiting thread a "kick" to make it wake up and re-load its context. I realise I could write my own custom ru

Re: How to get music list?

2008-08-04 Thread Jean-Daniel Dupas
Le 4 août 08 à 06:06, Dave DeLong a écrit : And having experimented with this myself, AppleScript can be horrendously slow if you need to get information on more than about 50 tracks. I do not agree with this. I just try the following script and I managed to get more than 4500 tracks name i

Re: How to get music list?

2008-08-04 Thread Jean-Daniel Dupas
Le 4 août 08 à 12:47, Gregory Weston a écrit : Kyle Sluder wrote: 4) Parse the iTunes Library XML files. #4 is unsupported, but also the only way to get access to the iTunes library when iTunes isn't running. The approach you take is dictated by your functional requirements. I was under t

Re: Instance vars, local vars and speed

2008-08-04 Thread Jean-Daniel Dupas
Le 4 août 08 à 13:26, Trygve Inda a écrit : I am transitioning some code from Carbon to Cocoa and redesigning a lot of how things work. I am doing a bit of low-level pixel manipulation and wondering about speed of access to variables declared in a method vs those declared at the object lev

Re: Documentation

2008-08-04 Thread Jean-Daniel Dupas
Le 4 août 08 à 14:26, Allison Newman a écrit : Following on from my previous message, a few months back, we had a long discussion on this list about whether the documentation was of a good quality or not. This is an example where I find myself completely unable to find the documentation t

Re: Colour of Symlink

2008-08-05 Thread Jean-Daniel Dupas
Le 5 août 08 à 08:13, Gerriet M. Denkmann a écrit : I want to get the colour of a symlink (NOT the colour of the thing the symlinks points at). Is there a Cocoa way to get this? Currently I am using FSPathMakeRef (or CFURLGetFSRef) to get an FSRef, and then FSGetCatalogInfo to get the colo

Re: Localize App Title?

2008-08-05 Thread Jean-Daniel Dupas
Le 5 août 08 à 13:25, Chunk 1978 a écrit : i've localized the info.plist file, and added these keys to the english subfile: LSHasLocalizedDisplayName CFBundleDisplayName New App Title but it still shows my original app name... Please read the documentation. http://developer.apple.co

Re: How is image drawing rate effected by image resolution and size?

2008-08-05 Thread Jean-Daniel Dupas
Le 5 août 08 à 19:48, Frederick Bartram a écrit : I am having difficulty understanding the issues involved in image drawing speed. I have a large, ~10K x 10K image in a scrolling view. The image is loaded as a PNG file into an NSImageView from a nib. I am getting large differences in the

Re: Loading a class with a specific superclass from a bundle

2008-08-05 Thread Jean-Daniel Dupas
Le 5 août 08 à 21:59, Chris Hanson a écrit : On Aug 5, 2008, at 11:19 AM, Elan Feingold wrote: I can load the principal class of a bundle with: NSBundle* bundleToLoad = [NSBundle bundleWithPath:@"..."]; Class exampleClass = [bundleToLoad principalClass]); Actually, this loads the bundle an

Re: Rotate NSString... I give up :(

2008-08-06 Thread Jean-Daniel Dupas
Shouldn't be this instead (check the translations' signs) ? [tr translateXBy:dx yBy:dy]; // center or rect will be the center of rotation [tr rotateByDegrees:90]; // rotate it [tr translateXBy:-dx yBy:-dy]; // move it back Le 6 août 08 à 08:46, Vitaly Ovchinnikov a écrit : Hello, I need t

Re: "backporting" nibs question / Rhapsody license anyone?

2008-08-06 Thread Jean-Daniel Dupas
Le 6 août 08 à 09:50, Bill Bumgarner a écrit : On Aug 6, 2008, at 12:19 AM, Ralf Edmund Stranzenbach wrote: because i'm currently facing a comparable situation - i'd like to migrate old NeXT style mails and mailboxes and also some old NeXTstep based applications for my personal use - i'm re

Re: autorelease CGImageRef?

2008-08-06 Thread Jean-Daniel Dupas
Be carefull when you mix CFType memory management, and obj-c memory management. It works well when you do not use GC, but may become problematic if you do not take special care with GC code. If I'm not wrong, it should be something like this: [NSMakeCollectable(aCGImageRef) autorelease]; L

Re: autorelease CGImageRef?

2008-08-08 Thread Jean-Daniel Dupas
Le 8 août 08 à 16:17, Thomas Engelmeier a écrit : Am 07.08.2008 um 17:24 schrieb Chris Hanson: This appears correct, except for the fact that, for reasons known only to Apple, although CFMakeCollectable is available in 10.4, the trivial NSMakeCollectable macro is available only in 10.5.

Re: Application control

2008-08-08 Thread Jean-Daniel Dupas
Le 8 août 08 à 11:47, Finlay Dobbie a écrit : On Thu, Aug 7, 2008 at 8:51 PM, falcon <[EMAIL PROTECTED]> wrote: I have application written using Qt library. I have a network of about 40 mac minis. Now I have to connect to each of these macs using ARD and change one parameter on main window

Re: CGImageSourceCreateFromURL failed with error -11

2008-08-08 Thread Jean-Daniel Dupas
Le 8 août 08 à 20:56, Ken Ferry a écrit : Hi James, Nicholas, I still bet it's someone holding too many file descriptors open. Nicholas, when you said this, "but I have forced the thumbnail creation to have at most 10 files opened at the same time", what did you mean? You can see what files

Re: How to tell whether an executable supports GC?

2008-08-09 Thread Jean-Daniel Dupas
You can also create your own helper tool compiled with GC support and, that just preflight the bundle you pass as argument and return the result. It's a little more works, but it's cleaner too. Le 9 août 08 à 03:32, André Pang a écrit : On 08/08/2008, at 3:18 PM, Chris Suter wrote: You w

Re: Using @selector()

2008-08-09 Thread Jean-Daniel Dupas
Le 9 août 08 à 10:34, Christian Giordano a écrit : Hi guys, I'm a newbie and I'm reading a book which shows the two different option to link programmatically a control to an action: SEL mySelector; mySelector = @selector(methodName:); [myButton setAction:mySelector]; OR SEL mySelector; mySel

<    1   2   3   4   5   6   7   8   9   10   >