Re: What to use instead of operatingSystemVersionString

2012-02-24 Thread Jean-Daniel Dupas
Le 24 févr. 2012 à 07:56, Gerriet M. Denkmann a écrit : > The documentation says of NSProcessInfo operatingSystemVersionString: > "This string is not appropriate for parsing". But if fails to mention what to > use instead. > > So what should I use? Gestalt? Or is there some more convenient Coco

Re: [Obj-C] if (self) vs. if (self != nil)

2012-02-27 Thread Jean-Daniel Dupas
Le 27 févr. 2012 à 02:40, Graham Cox a écrit : > > On 27/02/2012, at 12:13 PM, William Squires wrote: > >> I prefer the "if (self = [super init])" combined form, myself. > > > One potentially annoying thing about this form is that, if you compile with > plenty of warnings on, such as the pos

Re: Multiple declarations of objc_msgSend_stret

2011-02-04 Thread Jean-Daniel Dupas
I don't know what the status of this feature in the last Xcode version, but clang supports the unused attribute on obj-c ivar. I have something like this to workaround this kind of warning: #if __has_feature(attribute_objc_ivar_unused) #define UNUSED_IVAR __attribute__((unused)) #e

Re: Multiple declarations of objc_msgSend_stret

2011-02-04 Thread Jean-Daniel Dupas
Oups, wrong mailing list (and subject). Sorry for the noise. Le 4 févr. 2011 à 09:54, Jean-Daniel Dupas a écrit : > I don't know what the status of this feature in the last Xcode version, but > clang supports the unused attribute on obj-c ivar. > > I have something like this t

Re: Get ProcessSerialNumber of last front application

2011-02-09 Thread Jean-Daniel Dupas
Carbon events are events. As long as you don't receive one, your app is waiting consuming 0% of the CPU. Le 9 févr. 2011 à 20:05, Mr. Gecko a écrit : > The only question I would have is if I were to track the applications all the > time, how much time on the processor would it require, would it

Re: Performing the selector from a stored IMP

2011-02-11 Thread Jean-Daniel Dupas
Le 11 févr. 2011 à 13:21, Joanna Carter a écrit : > Hi folks > > I want to store a "method pointer" in a dictionary, recover it and call it > from elsewhere in code. > > So, I have code like this to store the "method pointer": > > { > IMP anIMP = [anObject methodForSelector:@selector( myMeth

Re: Performing the selector from a stored IMP

2011-02-11 Thread Jean-Daniel Dupas
Le 11 févr. 2011 à 14:31, Joanna Carter a écrit : > Hi Jerry > >> You've misunderstood what an IMP *is*. > > Heheheh, I thought as much :-) > >> If you want to store a method, you could probably wrap that the pointer >> value of an IMP as an NSValue. Read NSValue. Or, for persistent storage

Re: Get ProcessSerialNumber of last front application

2011-02-11 Thread Jean-Daniel Dupas
, 2011, at 1:21 PM, Jean-Daniel Dupas wrote: > >> Carbon events are events. As long as you don't receive one, your app is >> waiting consuming 0% of the CPU. >> >> Le 9 févr. 2011 à 20:05, Mr. Gecko a écrit : >> >>> The only question I would have

Re: 10.6 Snow Leopard API for blocking screensaver/idle?

2011-02-14 Thread Jean-Daniel Dupas
Le 14 févr. 2011 à 23:03, Eric Wing a écrit : > Is there an API in Snow Leopard to suppress/block/prevent the > screensaver from coming up? The new API is supposed to be IOPMAssertionCreateWithName() with kIOPMAssertionTypeNoDisplaySleep, but AFAIK, it does not prevent screen saver (at least i

Re: Community Suggestions on Encryption

2011-02-15 Thread Jean-Daniel Dupas
Le 15 févr. 2011 à 16:35, Brad Stone a écrit : > I've been doing a lot of hunting to find a simple way for me to encrypt an > NSString and NSData. I've found a bunch of useful blogs like Cocoa Nut > (http://cocoa-nut.de/?tag=encryption, Deusty:Using OpenSSL in Cocoa > (http://deusty.blogspot.

Re: Event Tap(CFMachPortRef) problem for Hot Key- callback is not invoked

2011-03-08 Thread Jean-Daniel Dupas
Le 8 mars 2011 à 04:40, Deepa a écrit : > Hi, > > I am developing a desktop application that supports one of the feature > through Hot Key. I am using Event Tap for this to work. > > But, sometimes (randomly) the callback is not invoked; Hot Key does not work > and hence the feature seems to

Re: Debugging a sleepless Mac

2011-03-16 Thread Jean-Daniel Dupas
Le 16 mars 2011 à 19:00, Laurent Daudelin a écrit : > On Mar 16, 2011, at 09:35, Matt Gough wrote: > >> On 16 Mar 2011, at 15:32, Kyle Sluder wrote: >> >>> On Wed, Mar 16, 2011 at 5:37 AM, Matt Gough wrote: So it seems that something else is preventing idle sleep, but I've no idea h

Re: Hash Values in Custom Classes

2011-03-29 Thread Jean-Daniel Dupas
Le 29 mars 2011 à 22:04, Peter Lübke a écrit : > > Am 28.03.2011 um 20:06 schrieb Sean McBride: > >> >> Are you aware that starting in 10.6, the OS provides 'file reference >> URLs' which are much like FSRefs. See: >> >>

Re: autorelease pool comprehension

2011-03-30 Thread Jean-Daniel Dupas
Le 30 mars 2011 à 18:53, Apple Developer a écrit : > Reading about autorelease pools gave me the idea that I could reduce the > memory footprint of my iPhone app. So, to aid in my understanding of > autorelease pools, I created a pool in a small loop and released it at the > end. Then, I ran t

Re: Framework Installation Directory

2011-04-08 Thread Jean-Daniel Dupas
Or do a symlink of MyApp.app/Contents/Frameworks into your daemon Contents directory (using a build script too). cd Daemon.app/Contents/ ln -s ../../../Frameworks Frameworks (I didn't check the count of '..' so it may be wrong, but you get the idea). > Yeah, that's how I'd do it, add a "run scr

Re: drawing onto CVPixelBuffer

2011-05-06 Thread Jean-Daniel Dupas
Le 6 mai 2011 à 22:22, eveningnick eveningnick a écrit : > Hi > I have a CVPixelBuffer with some background picture. > I need to draw on this background some foreground image. I don't need > to preserve the initial CVPixelBuffer's content - i just need to add a > small foreground watermark onto

Re: drawing onto CVPixelBuffer

2011-05-06 Thread Jean-Daniel Dupas
Le 6 mai 2011 à 23:30, eveningnick eveningnick a écrit : > the pixel format of the CVPixelBufferRef is k32BGRAPixelFormat It should work. The list of supported format is here: “Supported Pixel Formats.” -- Jean-Daniel ___ Cocoa-dev mailing list

Re: dealloc and scarce resources

2011-06-30 Thread Jean-Daniel Dupas
Le 30 juin 2011 à 08:19, James Merkel a écrit : > > On Jun 29, 2011, at 11:07 PM, Kyle Sluder wrote: > >> On Wed, Jun 29, 2011 at 10:38 PM, James Merkel wrote: >>> Ok, thanks. For what I'm doing file descriptors are not a scarce resource. >> >> File descriptors are almost always a scarce reso

Re: CFMutableDictionary Capacity

2011-07-20 Thread Jean-Daniel Dupas
Le 21 juil. 2011 à 00:30, Jens Alfke a écrit : > > On Jul 20, 2011, at 2:34 PM, Andreas Grosam wrote: > >> According the doc, the parameter "capacity" in function >> CFDictionaryCreateMutable() sets the *maximum number* of key-value pairs >> which can be inserted into the container. That is,

Re: CFMutableDictionary Capacity

2011-07-20 Thread Jean-Daniel Dupas
Le 21 juil. 2011 à 01:48, Jean-Daniel Dupas a écrit : > > Le 21 juil. 2011 à 00:30, Jens Alfke a écrit : > >> >> On Jul 20, 2011, at 2:34 PM, Andreas Grosam wrote: >> >>> According the doc, the parameter "capacity" in function >>> CFDic

Re: NSWindowController window deprecated

2011-07-23 Thread Jean-Daniel Dupas
Make sure you import all the required headers (especially the one defining MainWindowController). Le 23 juil. 2011 à 21:29, Andre Masse a écrit : > Not sure what's going on, I have my NSWindowController subclass declared as: > > @interface MainWindowController : NSWindowController > > and ha

Re: Xcode 3.2.6 on Lion ?

2011-07-23 Thread Jean-Daniel Dupas
Le 23 juil. 2011 à 23:22, Mike Abdullah a écrit : >> Oh, then there's 10.5 thing with libcrypto > > As far as I can tell that got fixed for the GM. > What's got fixed, and what GM ? AFAIK, if you link on libcrypto from the 10.6 or 10.7 SDK (whatever Xcode version you use), you cannot run yo

Re: Xcode 3.2.6 on Lion ?

2011-07-23 Thread Jean-Daniel Dupas
Le 23 juil. 2011 à 23:40, Conrad Taylor a écrit : > > > Sent from my iPhone > > On Jul 23, 2011, at 2:28 PM, Jean-Daniel Dupas wrote: > >> >> Le 23 juil. 2011 à 23:22, Mike Abdullah a écrit : >> >>>> Oh, then there's 10.5 thing with l

Re: Does anyone else dislike Xcode 4?

2011-07-25 Thread Jean-Daniel Dupas
Le 25 juil. 2011 à 09:47, vincent habchi a écrit : > Well, I wouldn’t want to throw more oil on the fire, as the French saying > goes, but, in my opinion, this looks like tycoons arguing about the color of > their Ferraris or which Bordeaux grand cru (or whatever else). Xcode is a tool we hav

Re: Does anyone else dislike Xcode 4?

2011-07-25 Thread Jean-Daniel Dupas
Le 24 juil. 2011 à 23:28, Ed Wynne a écrit : > > On Jul 24, 2011, at 3:46 PM, Gary L. Wade wrote: > >> As I mentioned before, everyone should go to bugreporter.apple.com and enter >> bugs against this horrible MS Windows method of UI that prevents usable >> viewing of multiple files that has

Re: Does anyone else dislike Xcode 4?

2011-07-25 Thread Jean-Daniel Dupas
Le 25 juil. 2011 à 19:42, Nick Zitzmann a écrit : >> > > This is my main grievance with Xcode 4 as well, and really, it's the second > time this has happened. The original Project Builder had an all-in-one view, > and developers complained, so they added a CodeWarrior-like condensed view to >

Re: Disable Lion's window restoration?

2011-07-26 Thread Jean-Daniel Dupas
Le 26 juil. 2011 à 02:33, Gerd Knops a écrit : > Hi, > > Is there an application-global way of disabling window restoration? > > All I can find is NSWindow's "- (BOOL)isRestorable" method (and it's > relatives). > > I was hoping for something more global, like a "- (BOOL)shouldRestoreWindows"

Re: NSWorkspace in a daemon

2009-11-30 Thread Jean-Daniel Dupas
Le 30 nov. 2009 à 16:25, Bill Garrison a écrit : > > On Nov 30, 2009, at 9:17 AM, Nyxouf da ouf wrote: > >> Hi, >> >> I have an Obj-c program who run as a daemon, using launchd, and that look >> for NSWorkspaceDidMountNotification. >> >> *[[[NSWorkspace sharedWorkspace] notificationCenter] ad

Re: NSWorkspace in a daemon

2009-11-30 Thread Jean-Daniel Dupas
Using DiskArbitration framework that is Daemon safe. Le 30 nov. 2009 à 16:51, Nyxem a écrit : > So what is the right way to do this ? > > Nyxem. > > On Nov 30, 2009, at 4:37 PM, Jean-Daniel Dupas wrote: > >> >> Le 30 nov. 2009 à 16:25, Bill Garrison a écrit : &g

Re: Retrieving informations about Network Interfaces

2009-12-03 Thread Jean-Daniel Dupas
Le 3 déc. 2009 à 09:55, Zephyroth Akash a écrit : > Hi, > > I need to extract some informations about Network Interfaces, like getting > IOInterfaceExtraFlags , IOInterfaceFlags ... etc. > > After some search I've found that the related values are defined in > bsd/net/if.h ... but where is th

Re: Crash when 'open POSIX file /..' from AppleScript

2009-12-14 Thread Jean-Daniel Dupas
Le 14 déc. 2009 à 19:13, Sean McBride a écrit : > On 12/12/09 11:12 PM, Jerry Krinock said: > >> Working on a Core Data document-based app. Executing the following >> AppleScript: >> >> tell application "MyApp" >> open POSIX file "/path/to/SomeDocument" >> end tell >> >> results in progr

Re: memcpy with 64 bit

2009-12-15 Thread Jean-Daniel Dupas
malloc/calloc is a better way. «Mac OS X implements a highly-tuned, threadsafe allocation library, providing standard implementations of the malloc,calloc, realloc, and free routines, among others. If you are allocating memory using older routines such as NewPtr or NewHandle, you should change

Re: memcpy with 64 bit

2009-12-16 Thread Jean-Daniel Dupas
Even on 32 bits, the recommended way is to use a QTOpenGLVisualContext and CoreVideo, not QuickDraw and upload the texture yourself. Unfortunately there is no equivalent in 64 bits yet. But if your need are just to draw the movie, you should use a QTMovieView which do this for you. And if you

Re: launching application after reboot

2009-12-17 Thread Jean-Daniel Dupas
Le 17 déc. 2009 à 20:24, Jens Alfke a écrit : > > On Dec 17, 2009, at 10:26 AM, Kyle Sluder wrote: > >> Why?! If the user wants to start your program, they will start your program. > > It could be necessary for some sort of installer that needs to restart the OS > and then needs to run someth

Re: Interface Builder backwards compatibility

2009-12-18 Thread Jean-Daniel Dupas
Le 18 déc. 2009 à 10:48, Sander Stoks a écrit : > Hello all, > > I am developing an app on my 10.6 machine but try to keep compatibility with > 10.4. The binary itself is OK - I can select 10.4 as a target and build a > working universal binary. However, I seem to have introduced a problem i

Re: Thread safe QT playback

2009-12-18 Thread Jean-Daniel Dupas
Le 18 déc. 2009 à 17:10, slasktrattena...@gmail.com a écrit : > Hi all, > > QTKit docs say that Quicktime playback is designed to work without > interruption on the main thread. This works fairly well, most of the > time, but I notice occasional glitches in the playback when the > computer is bu

Re: Interfacing cocoa/obj-c within a C plug-in API

2009-12-22 Thread Jean-Daniel Dupas
Le 22 déc. 2009 à 10:56, Graham Cox a écrit : > > On 22/12/2009, at 10:22 AM, Rich E wrote: > >> Hi, >> >> I am new to Cocoa and Objective-C both, but I need the two in order to get >> tablet functionality into one of my favorite applications (Puredata) on Mac >> OS X. First off, I know that y

Re: Are views active or inactive?

2009-12-23 Thread Jean-Daniel Dupas
Le 23 déc. 2009 à 12:06, Gregory Weston a écrit : > Rick Mann wrote: > >> On Dec 22, 2009, at 19:51:03, Kyle Sluder wrote: >> >>> On Tue, Dec 22, 2009 at 9:45 PM, Rick Mann wrote: I'm listening for that notification. Sure is a clunky way to do things. I've never used a view framewor

Re: Are views active or inactive?

2009-12-23 Thread Jean-Daniel Dupas
Le 23 déc. 2009 à 13:50, Graham Cox a écrit : > > On 23/12/2009, at 10:15 PM, Jean-Daniel Dupas wrote: > >>> Did you happen to have an 'a-ha' moment when you typed that sentence? >>> "Views" don't generally have an active/inactive state. Con

Re: Do I need to download both XCode for both Mac & iPhone

2010-01-04 Thread Jean-Daniel Dupas
Le 4 janv. 2010 à 23:23, Rick Mann a écrit : > > On Jan 4, 2010, at 01:41:56, Jan Erik Moström wrote: > >> Newbie Q: I've been playing with the XCode env for iPhone for a few weeks >> and was thinking about doing some OS X dev but do I need to download the >> whole OS X version of XCode or is

Re: Turn off font hinting?

2010-01-05 Thread Jean-Daniel Dupas
Le 5 janv. 2010 à 16:44, Sander Stoks a écrit : >> I don't think Quartz's text renderer uses hinting in the normal sense; >> this is part of why text looks different on Mac than on Windows. (Subpixel >> anti-aliasing largely removes the need for hinting, and makes the hints >> actually mess up th

Re: Using AppleEvents to copy and past text from any application

2010-01-05 Thread Jean-Daniel Dupas
Le 5 janv. 2010 à 16:46, Jesse Grosjean a écrit : > I'm developing a small open source app called QuickCursor. > > - http://www.hogbaysoftware.com/products/quickcursor/ > - http://github.com/jessegrosjean/quickcursor > > The idea is to replace the input manage based "edit in" features with > a

Re: Printing doc file using cocoa

2010-01-06 Thread Jean-Daniel Dupas
Le 6 janv. 2010 à 14:55, Ramesh P a écrit : > Hi all, > > Is it possible to print a doc file using cocoa application? > If possible please give some suggestions. > I printed pdf and image files.. But i didn't get any solution for doc files. > FWIW, the sources of TextEdit are available in Xco

Yet another NSTreeController memory issue

2010-01-07 Thread Jean-Daniel Dupas
Hi, I'm using NSTreeController to display an object graph in an outline view. The object graph is not CoreData based, this is a very simple model where each object represent a node and may have an array of children. I do something very simple. I create a root node and insert it to the tree con

Re: Core Video CIFilters/ playback / compression suggestions?

2010-01-15 Thread Jean-Daniel Dupas
Le 14 janv. 2010 à 20:11, Travis Kirton a écrit : > Hi, > > We're working with Core Video to play back videos @ 1024 x 768 resolution. > The videos are stacked on top of one another and revealed as a user draws > over top of them. To achieve this "drawing into" the stack of videos, we're > fil

Re: NSDictionary trouble

2010-01-19 Thread Jean-Daniel Dupas
Le 20 janv. 2010 à 00:18, Kyle Sluder a écrit : > On Tue, Jan 19, 2010 at 3:09 PM, Shawn Rutledge > wrote: >> Well yeah, that's one of the reasons java.lang.String is immutable. >> But it helps that java.lang.Object has both hashCode and equals, so >> any object can be put into a collection that

Re: Allow only root/admin users to execute the cocoa app

2010-01-25 Thread Jean-Daniel Dupas
Le 25 janv. 2010 à 07:47, vincent habchi a écrit : > Le 24 janv. 2010 à 22:31, Todd Heberlein a écrit : > >>> I want to allow my cocoa app to be only launched by root/admin users. >>> How can i achieve this? >> >> As I think has already been mentioned, the UNIX approach is to set the >> applic

Re: Allow only root/admin users to execute the cocoa app

2010-01-25 Thread Jean-Daniel Dupas
Le 25 janv. 2010 à 11:15, vincent habchi a écrit : > Le 25 janv. 2010 à 10:43, Jean-Daniel Dupas a écrit : > >> So unless you think you know better than Apple what you're doing, never run >> an GUI application with privileges. Gwynne's anwser give you some reasons

Re: What is the equivalent of SetSystemUIMode() in Leopard and above?

2010-01-25 Thread Jean-Daniel Dupas
Le 25 janv. 2010 à 12:47, Arun a écrit : > Hi All > > Are there any cocoa equivalent API's for SetSystemUIMode() available in > Leopard 10.5 and above? > I want to hide dock and menu item at run time in my application. > NSApplication presentation options, but available in Snow Leopard only.

Re: How to hide dock item and application menu?

2010-01-25 Thread Jean-Daniel Dupas
Le 25 janv. 2010 à 23:24, Jens Alfke a écrit : > > On 25 Jan 2010, at 18:06, Arun wrote: > >> Hi All, >> >> In my application i need to provide an option to hide its dock icon as well >> as the application menu. >> How can i achieve this? I know that In Info.plist if i add an entry to run >>

Re: What is the equivalent of SetSystemUIMode() in Leopard and above?

2010-01-27 Thread Jean-Daniel Dupas
Le 27 janv. 2010 à 11:48, Alastair Houghton a écrit : > On 27 Jan 2010, at 05:36, Charles Srstka wrote: > >> Or you could just do something like this: >> >> if(floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5) >> { >> [NSApp setPresentationOptions:whatever]; >> } >> else >> { >>

Re: NSString category name collision?

2010-01-27 Thread Jean-Daniel Dupas
Le 27 janv. 2010 à 12:00, jonat...@mugginsoft.com a écrit : > > On 26 Jan 2010, at 23:22, Greg Parker wrote: > >> On Jan 26, 2010, at 3:19 PM, Sean McBride wrote: >>> On 1/26/10 4:08 PM, jonat...@mugginsoft.com said: I added a name space prefix to my method definition and the exception >>>

Re: Hot to define a connection from source code?

2010-01-28 Thread Jean-Daniel Dupas
Le 28 janv. 2010 à 19:57, Jens Alfke a écrit : > > On Jan 28, 2010, at 9:52 AM, Jonathan Chacón wrote: > >> thanks for your help but I don't know where I have to define de connection >> between outleets and actions. I have to type them in the appController, >> windowDelegate or where the outl

Re: Returning a nil float?

2010-01-29 Thread Jean-Daniel Dupas
Le 30 janv. 2010 à 01:44, Chunk 1978 a écrit : > i'm almost 100% sure it's not possible to return a nil on basic data > types, but just incase i'll post the question. > > -- > - (float)panForSoundWithName:(NSString *)soundName > { >

Re: Loading of Mach-O executable files.

2010-01-30 Thread Jean-Daniel Dupas
Le 29 janv. 2010 à 16:58, Richard Penwell a écrit : > Dear list, > > I've been toying around with some problems in the world of dynamic code > loading... (a vast and mythical place). I understand that there is a > fundamental difference between Mach-O executables and Mach-O dynamic > librarie

Re: dock tile overlay image

2010-01-30 Thread Jean-Daniel Dupas
Le 29 janv. 2010 à 17:02, Felipe Heidrich a écrit : > Using Carbon I can place overlay images on the application dock tile by > calling OverlayApplicationDockTileImage(). > > Is it possible to do the same using Cocoa ? > I read NSDockTile and NSApplication Class Reference and I'm afraid the > an

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Jean-Daniel Dupas
Don't bother with custom callback, CFType one works with any objects. Le 1 févr. 2010 à 09:32, Rick Mann a écrit : > I tried doing this: > > const void* > retainCallback(CFAllocatorRef inAlloc, const void* inValue) > { > NSObject* val = (NSObject*) inValue; > [val retain]; > r

Re: Returning a nil float?

2010-02-01 Thread Jean-Daniel Dupas
Le 1 févr. 2010 à 19:17, Michael Gardner a écrit : > On Jan 29, 2010, at 6:44 PM, Chunk 1978 wrote: > >> i'm almost 100% sure it's not possible to return a nil on basic data >> types, but just incase i'll post the question. >> >> -- >> - (floa

Re: Reading Modifier Keys Down during Launch - still needs "Carbon"?

2010-02-02 Thread Jean-Daniel Dupas
Le 2 févr. 2010 à 15:51, Jerry Krinock a écrit : > In Mac OS 10.6, during -applicationDidFinishLaunching, [NSEvent currentEvent] > returns nil, so the usual code, > > [[NSEvent currentEvent] modifierFlags] > > is not useful for determining if a modifier key was held down during launch. > (

Re: Analyzer Questions

2010-02-02 Thread Jean-Daniel Dupas
If for some reason you really want to use a naming convention that confuses the analyzer, you can also use the ns_returns_retained and cf_returns_retained clang attributes. For details about these attributes (how to use them in a way that do not conflict with GCC), have a look at the following

Re: Cocoa+OpenGL app crashes iMac

2010-02-09 Thread Jean-Daniel Dupas
Le 9 févr. 2010 à 22:38, Shayne Wissler a écrit : > I have a multithreaded Cocoa+OpenGL app that can reliably bring down > OSX. I am using the latest released/patched version of OSX, all > updates have been downloaded and applied. > > The application has a thread that displays video frames as Op

Re: Guidance on use of Application Support folder

2010-02-12 Thread Jean-Daniel Dupas
Le 12 févr. 2010 à 19:02, Sean McBride a écrit : > On 2/12/10 9:51 AM, Kyle Sluder said: > >> Plea from a former sysadmin: *please* use a PackageMaker package, with >> the permissions bits set appropriately in the BOM, *not* an installer >> application! > > Could you elaborate? We have been th

Re: Refresh com.apple.symbolichotkeys.plist

2010-02-17 Thread Jean-Daniel Dupas
Le 17 févr. 2010 à 01:09, DeNigris Sean a écrit : >> Is there any way to cause the system to re-read >> com.apple.symbolichotkeys.plist.plist in Cocoa (or anywhere else)? I want >> to programmatically change a shortcut (which is no problem), but I want it >> to take effect immediately. Syste

Re: Dynamically populate a popup menu

2010-02-17 Thread Jean-Daniel Dupas
See NSMenuDelegate protocol. There is some method to dynamically populate the menu. Le 17 févr. 2010 à 16:09, Steven Degutis a écrit : > Check out NSPopUpButton's NSPopUpButtonWillPopUpNotification > > On Wed, Feb 17, 2010 at 2:49 AM, Peter N Lewis wrote: > >> Is there any way to dynamically p

Re: Dynamically populate a popup menu

2010-02-17 Thread Jean-Daniel Dupas
e, I still prefer to use the > NSPopUpButton's notification myself. Touching the button's internal menu > seems like dipping my fingers where they don't belong. > > -Steven > > On Wed, Feb 17, 2010 at 10:41 AM, Jean-Daniel Dupas > wrote: > > See NSMenuDelegate prot

Re: Overriding NSMenuItem's drawing

2010-02-17 Thread Jean-Daniel Dupas
Le 17 févr. 2010 à 17:30, Tom Davie a écrit : > I need an NSMenuItem that rather than drawing an NSImage in it's cell draws > *part* of an NSImage, is it possible to override NSMenuItem's drawing in any > way to achieve this? I don't see the relevant methods. Use a View in your menu item: htt

Re: NSPropertyListSerialization error with apparently OK data

2010-02-18 Thread Jean-Daniel Dupas
Don't think so, archiving is not serialization and it's just a dump of the object in XML/binary format, so you can't have reserved keyword. The plist look definitively OK. (it's even possible to import it in Plist Editor as a text formatted plist if you remove the extra '{' '}' enclosing the

Re: High Level Toolkit -- is it obsolete or not?

2010-02-23 Thread Jean-Daniel Dupas
Le 23 févr. 2010 à 13:08, Ken Thomases a écrit : > On Feb 23, 2010, at 1:19 AM, Nick Zitzmann wrote: > >> On Feb 22, 2010, at 12:53 PM, Joel May wrote: >> >>> If High Level Toolkit is ok, then why doesn't it appear in the docs. If I >>> search the Mac OS X Reference Library, it does not get

Re: High Level Toolkit -- is it obsolete or not?

2010-02-23 Thread Jean-Daniel Dupas
You don't have to build a separate version. Just test for method availability at runtime: if ([NSEvent respondsToSelector:@selector(pressedMouseButtons)]) return [NSEvent pressedMouseButtons]; else // do it the old way. Le 23 févr. 2010 à 23:18, Joel May a écrit : > Hey Eric,

Re: Deprecated APIs

2010-02-24 Thread Jean-Daniel Dupas
Le 24 févr. 2010 à 20:36, Steve Christensen a écrit : > On Feb 24, 2010, at 11:04 AM, Bill Bumgarner wrote: > >> On Feb 23, 2010, at 8:57 PM, Steve Christensen wrote: >> That code uses blocks, though, which implies that it will be compiled using a later version of Objective-C. Will t

Re: Correct way to overide synthesized setter?

2010-02-28 Thread Jean-Daniel Dupas
Le 28 févr. 2010 à 17:23, Chris Tracewell a écrit : > I have two synthesized properties - A and B. Whenever A changes I need B to > be updated to A.keypath. Is the correct way to do this to override the > synthesized setter of A like so? > > -(void)setA:(id)value > { > A = value >

Re: Carbon is C++?

2010-03-01 Thread Jean-Daniel Dupas
Le 1 mars 2010 à 05:55, Erik Buck a écrit : > > On Feb 28, 2010, at 10:49 PM, David Rowland wrote: > >> >> On Feb 28, 2010, at 7:24 PM, Erik Buck wrote: >> >>> I disagree. I have written very low latency device drivers in Objective-C. >>> Why do you think Objective-C has too much "latency"

Re: Switching methods in private classes in Apple frameworks

2010-03-12 Thread Jean-Daniel Dupas
Method exchange is dangerous because if the target class (NSConcreteNotification) does not override the target function (dealloc), you may exchange it's superclass dealloc method instead and may end up overriding a method in a base class. Use it with great care and avoid it in production code i

Re: Performance, Efficiency - Coding practice

2009-05-29 Thread Jean-Daniel Dupas
Le 29 mai 09 à 11:31, Alexander Spohr a écrit : Am 29.05.2009 um 02:55 schrieb John Ku: And yeah, NSMutableString will be initialized else where and released later. Why use a mutable string at all? Just retain the new string and dump the old one. Use @property (retain) NSString *title

Re: Help with SHA class

2009-06-04 Thread Jean-Daniel Dupas
An other alternative is using the CommonCrypto API (which does not require to link on other library like OpenSSL). man "Common Crypto" Le 4 juin 09 à 18:23, KK a écrit : I ran into a similar problem - but I decided to use libcrypto: man 3 sha1 or man 3 EVP_DigestInit Keita On Thu, Jun 4, 2

Re: finding bundle identifiers

2009-06-10 Thread Jean-Daniel Dupas
Le 10 juin 09 à 11:51, Ken Thomases a écrit : On Jun 10, 2009, at 4:27 AM, Rick C. wrote: to be more specific on what i'm trying to do i would like to be able to review the files in a preferences folder and find the related app on the system. so i was trying to come up with a list of id

Re: Reducing the Window size

2009-06-10 Thread Jean-Daniel Dupas
Le 10 juin 09 à 12:51, Arnab Ganguly a écrit : Hi All, From NSButton in the nib file is it possible to minimize part of the application window? Like in case of Itunes when I click on the + button the player content's lists get reduced and only the playing station can be visible.How can I ac

Re: App does not start on a different machine

2009-06-10 Thread Jean-Daniel Dupas
Le 11 juin 09 à 00:26, Martin Batholdy a écrit : hi, my app works fine on my macbook, but on a macbook pro it starts and then just disappears immediately after the start (nor error message). The OS version is the same, and the app is pretty simple (no graphic stuff or something like that

Re: App does not start on a different machine

2009-06-11 Thread Jean-Daniel Dupas
What about retrieving the crash log in ~/Library/Logs ? Le 11 juin 09 à 06:11, Nick Zitzmann a écrit : On Jun 10, 2009, at 8:35 PM, Martin Batholdy wrote: 11.06.09 04:24:15 com.apple.launchd[66] ([0x0-0x53053].com.yourcompany. test[762]) Exited abnormally: Trace/ BPT trap 11.06.09 04:24:

Re: Any Good Core Animation Tutorials?

2009-06-16 Thread Jean-Daniel Dupas
Le 16 juin 09 à 17:49, Chunk 1978 a écrit : humm... ok, so CA is 3D, which means X (length), Y (height) and Z (depth, or width), while CG is 2D so it only uses X and Y... so if i want to only have one layer on the screen at one time, is there still an advantage to using Z for enlargements in t

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Jean-Daniel Dupas
Le 17 juin 09 à 10:53, Chunk 1978 a écrit : is have this animation block with both Enlarge and Rotate, but only one work properly (the last one listed). what is the proper way to group the two transforms together: -=-=-=- //Animation Block [UIView beginAnimations:nil context:N

Re: Group CGAffineTransform Animations?

2009-06-17 Thread Jean-Daniel Dupas
most ideal way of doing this? On Wed, Jun 17, 2009 at 5:21 AM, Chunk 1978 wrote: thanks! :) On Wed, Jun 17, 2009 at 5:05 AM, Jean-Daniel Dupas wrote: Le 17 juin 09 à 10:53, Chunk 1978 a écrit : is have this animation block with both Enlarge and Rotate, but only one work properly (the

Crash in KVO when using -keyPathsForValuesAffecting

2009-06-20 Thread Jean-Daniel Dupas
Hello, I'm experiencing some difficulties with KVO and auto dependent keys. Am I doing something wrong, or should I fill a bug report ? Here is a test case. MyObject is a class with a single property: name. MyWrapper is a class that wrap a MyObject instance. It also declares a property 'na

Re: Crash in KVO when using -keyPathsForValuesAffecting

2009-06-20 Thread Jean-Daniel Dupas
Le 20 juin 09 à 20:56, Quincey Morris a écrit : On Jun 20, 2009, at 11:08, Jean-Daniel Dupas wrote: - (void)dealloc { [_object release]; [super dealloc]; } Try changing this to: - (void) dealloc { self.object = nil; [super dealloc]; } 'keyPathsForValuesAffectingNam

Re: Crash in KVO when using -keyPathsForValuesAffecting

2009-06-20 Thread Jean-Daniel Dupas
Le 20 juin 09 à 21:39, Jeff Johnson a écrit : Sorry, scratch that, I apparently misread your example. As Phil would say, I'm an idiot. Does +keyPathsForValuesAffecting... actually support true keypaths? The documentation is unclear. -Jeff If this is not supported, I will fill a bug r

Re: Crash in KVO when using -keyPathsForValuesAffecting

2009-06-21 Thread Jean-Daniel Dupas
Le 21 juin 09 à 11:26, Quincey Morris a écrit : On Jun 20, 2009, at 14:15, Jean-Daniel Dupas wrote: Thank you for the suggestion, but it does not solve the problem. Even trying w1.object = nil before unregistring the observer has no effect. When I looked at your code a little harder, I

Re: Screen capture Cocoa framework

2009-06-24 Thread Jean-Daniel Dupas
Le 24 juin 09 à 11:38, Andy Bell a écrit : Hi All, Does anyone know if there is a screen recording Cocoa framework out there? I want to record the screen much like Camtasia studio does on Windows and don't want to reinvent the wheel. I'm not aware of any OpenSource framework, but I

Re: Screen capture Cocoa framework

2009-06-24 Thread Jean-Daniel Dupas
just draw the cursor before calling glReadPixel()). Le 24 juin 09 à 13:47, Andy Bell a écrit : Hi Jean-Daniel, Thanks for that, do you know if it captures the mouse pointer as well? Are there any commercial frameworks? Thanks Andy On Wed, Jun 24, 2009 at 12:37 PM, Jean-Daniel Dupas

Re: icns to Icon\r

2009-06-25 Thread Jean-Daniel Dupas
Le 25 juin 09 à 00:45, Michael Hanna a écrit : Hi all, my goal is to create custom installer icons for a couple of Installer .pkg packages. I'm following the instructions at: http://www.khiltd.com/Downloads/prettypackages.html At the section "Into the Fray" he suggests to use the Finder to ge

Re: NSTableView bug?

2009-07-02 Thread Jean-Daniel Dupas
I've created a simple application with an NSTableView. I have written a delegate for this table, numberOfRowsInTableView:objectValueForTableColumn:row:, that returns the number of rows in the table when requested. My application uses the table view to display hexadecimal data on a flash m

Re: Bound array item is repeatedly copied and collected while scrolling table view

2009-07-07 Thread Jean-Daniel Dupas
Le 7 juil. 09 à 14:24, Rick Hoge a écrit : I have a nib file in which entries in an NSTableView are bound to an NSMutableArray via an NSArrayController. It is used in an application running under garbage collection. The array items are NSDictionaries, and one of these dictionaries con

Re: Wake computer from sleep

2009-07-10 Thread Jean-Daniel Dupas
Le 9 juil. 09 à 18:28, Mr. Gecko a écrit : Hello, I'm working on an alarm and I'm wondering what would be the best way to make it wake up the computer. I've heard of IOPMSchedulePowerEvent and I think it's the best way, but I'll need root privileges and I'm guessing the best way to do that

Re: Undo without Redo

2009-07-12 Thread Jean-Daniel Dupas
Le 12 juil. 09 à 16:10, John Nairn a écrit : I added an option to cancel some action in the middle of the action. The most convenient coding was to implement the cancel by calling undo in the NSUndoManager, but this adds a "Redo" action to redo the partial or incomplete changes (and leaves

Re: Efficiency of loading Localizable.strings and NSUserDefaults

2009-07-16 Thread Jean-Daniel Dupas
Le 16 juil. 09 à 04:55, Graham Cox a écrit : On 16/07/2009, at 6:45 AM, Development wrote: Anyone has some comments or ideas about this? Possibly someone with some inner understanding of how localized strings are read? Optimise later. You are fretting about the speed of loading string

Re: iTunes COM interface for Windows; need the equivalent for

2009-07-17 Thread Jean-Daniel Dupas
Le 17 juil. 09 à 22:39, Brad Gibbs a écrit : Thanks for sharing your code, George. Is there any way to access AirTunes with Objective-C / Cocoa or AppleScript? I've seen some information on daap that allows the use of AirTunes, but it's a private API, so I'm hesitant to use it, even for

Re: List classes in Bundle?

2009-07-22 Thread Jean-Daniel Dupas
You can listen NSBundleDidLoadNotification notifications. it contains @"NSLoadedClasses" key in the userinfo dictionary. This probably won't work for frameworks loaded at launch time, but may be helpful in some cases. Le 22 juil. 09 à 19:29, Keith Duncan a écrit : I've not used it but I

Re: NSSliderCell question

2009-07-23 Thread Jean-Daniel Dupas
Le 23 juil. 09 à 21:09, livinginlosange...@mac.com a écrit : I am employing an NSSliderCell in my table view, and I want to slow down the rate of change or increase the resolution of change using a modifier key like commands as I drag. This is employed in a few audio programs to assist a mi

Re: NSDictionary crash

2009-07-25 Thread Jean-Daniel Dupas
Le 25 juil. 09 à 21:59, slasktrattena...@gmail.com a écrit : On Sat, Jul 25, 2009 at 9:39 PM, Kyle Sluder wrote: As I mentioned, look at NSPropertyListSerialization. NSDictionary is a plist type and can be decoded from an NSData. OK, thanks. Also, is the NSData equivalent any safer than

Re: Dictionary with enum keys?

2009-07-27 Thread Jean-Daniel Dupas
Le 27 juil. 09 à 10:48, Debajit Adhikary a écrit : I need to create a dictionary/hashmap where the - Keys are enums - Values are some subclass of NSObject NSDictionary won't work here (enums don't conform to NSCopying). I could perhaps use a CFDictionaryRef here, but I'd like to know if

Re: Cocoa Document-Based App v. Windows MDI App

2009-07-27 Thread Jean-Daniel Dupas
Le 27 juil. 09 à 10:49, Aaron Burghardt a écrit : On Jul 27, 2009, at 12:50 AM, David Blanton wrote: I think I'll use: The Mac frameworks just don't support that approach. Sorry. I could re-implement MDI on the Mac, but it would be about a man-year's work. Do you want me to do that?"

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