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, it's not

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 CFDictionaryCreateMutable() sets the *maximum number* of key-value pairs

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 jmerk...@mac.com wrote: Ok, thanks. For what I'm doing file descriptors are not a scarce resource. File descriptors are almost always a scarce

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 that

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: 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

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 the

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: http://developer.apple.com/library/mac/#releasenotes/Cocoa/Foundation.html Good

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 mgo...@humyo.com wrote: So it seems that something else is preventing idle sleep, but I've no idea

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 be

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

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 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( myMethod: )];

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, store

Re: Get ProcessSerialNumber of last front application

2011-02-11 Thread Jean-Daniel Dupas
, 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 is if I were to track the applications all the time, how much time

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: 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))

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 to workaround

Re: Loading the Foundation at runtime

2011-01-25 Thread Jean-Daniel Dupas
Le 24 janv. 2011 à 17:39, Mathieu Suen a écrit : Hi All, In other to write a binding for a language I need to load the Foundation framework at run time. So just to test I wrote a simple example: --objc-test.c-- #include objc/runtime.h #include stdio.h #include

Re: Loading the Foundation at runtime

2011-01-25 Thread Jean-Daniel Dupas
Le 25 janv. 2011 à 14:55, Fritz Anderson a écrit : On 24 Jan 2011, at 10:39 AM, Mathieu Suen wrote: int main () { int error; objc_loadModule (Foundation, onLoad, error); return EXIT_SUCCESS; } --objc-test.c-- But the linker complain: Undefined symbols:

Re: Determining whether a dictionary is mutable or not

2011-01-15 Thread Jean-Daniel Dupas
Le 15 janv. 2011 à 13:18, Tito Ciuro a écrit : On Jan 15, 2011, at 1:04 PM, Ken Thomases wrote: On Jan 15, 2011, at 5:38 AM, Tito Ciuro wrote: On Jan 15, 2011, at 7:36 AM, Ken Ferry wrote: I'm not sure this has been made clear: It is intentional that it is difficult to determine

Re: [SOLVED] Unresponsive CFMessagePort

2011-01-07 Thread Jean-Daniel Dupas
Le 7 janv. 2011 à 06:37, Jerry Krinock a écrit : On 2011 Jan 06, at 17:33, Dave Keck wrote: Oh, `sudo launchctl bstree` might also be useful. Thank you, Dave. It was useful. It told me that my server port was active (A). This confirms what the Client tells me, that the port is

Re: [SOLVED] Unresponsive CFMessagePort

2011-01-07 Thread Jean-Daniel Dupas
Le 7 janv. 2011 à 10:22, Jean-Daniel Dupas a écrit : Le 7 janv. 2011 à 06:37, Jerry Krinock a écrit : On 2011 Jan 06, at 17:33, Dave Keck wrote: Oh, `sudo launchctl bstree` might also be useful. Thank you, Dave. It was useful. It told me that my server port was active

Re: Application that uninstalls itself

2011-01-03 Thread Jean-Daniel Dupas
Le 3 janv. 2011 à 16:48, eveningnick eveningnick a écrit : Hello I am writing an application that for users convenience has a button Uninstall. Inside, this uninstaller stops several launchd services, kextunloads a driver, deletes this driver and services and finally is supposed to delete

Re: App Will Not Terminate After Uncaught Excpetion

2010-12-16 Thread Jean-Daniel Dupas
Le 16 déc. 2010 à 17:32, Nick Zitzmann a écrit : On Dec 16, 2010, at 6:38 AM, Andreas Grosam wrote: In Cocoa, exceptions are considered fatal errors, and code is usually not exception safe. [citation needed] From Introduction to Exception Programming Topics for Cocoa “Important:

Re: App Will Not Terminate After Uncaught Excpetion

2010-12-16 Thread Jean-Daniel Dupas
Le 17 déc. 2010 à 00:06, Dave Keck a écrit : Presumably it is more functionally similar to: On my system, the exception is being caught from within -[NSApplication run]. So it would look like the implementation of -run shown here:

Re: Interprocess Communication (IPC) : Which technology to use?

2010-12-07 Thread Jean-Daniel Dupas
Le 7 déc. 2010 à 17:56, Keary Suska a écrit : On Dec 7, 2010, at 9:28 AM, Jerry Krinock wrote: My application needs to communicate with my associated Internet Plugin (a bundle that runs in web browsers). For example, here is one sequence: • App sends a hello to the plugin. • Plugin

Re: [CFBundleIdentifier] Is is really a hyphen or a minus?

2010-12-04 Thread Jean-Daniel Dupas
Le 4 déc. 2010 à 19:42, Iceberg-Dev a écrit : According to the documentation here: http://developer.apple.com/library/mac/#documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html%23//apple_ref/doc/uid/TP40009249-102070-TPXREF105 a CFBundleIdentifier value

Re: Drawers on windows...

2010-11-30 Thread Jean-Daniel Dupas
Le 30 nov. 2010 à 22:29, Sherm Pendley a écrit : On Tue, Nov 30, 2010 at 4:06 PM, lbland lbl...@vvi.com wrote: When drawers first came out they were all the rage. Then they went out of favor by some, so much so I thought they would be depreciated. But, it seems like drawers are sticking

Re: What is Mac's custom for an agent to display its GUI?

2010-11-16 Thread Jean-Daniel Dupas
Le 17 nov. 2010 à 05:21, John Joyce a écrit : On Nov 17, 2010, at 12:40 PM, Kyle Sluder wrote: On Tue, Nov 16, 2010 at 5:27 PM, eveningnick eveningnick eveningn...@gmail.com wrote: Hello! I have to write an application, that should run on the background. When the user needs, it should

Re: Threads and run loops

2010-11-05 Thread Jean-Daniel Dupas
Le 5 nov. 2010 à 08:29, Oleg Krupnov a écrit : Hi, I've got a couple of questions: 1. What happens if I send a message via -performSelector:onThread: from one thread to another, before the other thread has time to enter its run loop? Is the message going to be lost? IIRC, the message

Re: [iPhone] HTTPS / client Certificate / configuration profile

2010-11-03 Thread Jean-Daniel Dupas
Le 3 nov. 2010 à 14:58, Sandro Noël a écrit : Greetings. Scenario: Our application accesses the content of a secure web server, the server is configured to ask the client for a certificate. and other security features. HTTPS 1: SSL connection to server with server certificate 2:

Re: NSFileManager and Resource Forks

2010-10-27 Thread Jean-Daniel Dupas
Le 27 oct. 2010 à 19:52, k...@highrolls.net a écrit : Here is my code to write a resource fork for a given file. NSString *dataPath = [[NSBundle mainBundle] pathForResource:@RSRC ofType:@PCSMAC]; NSString *rsrcPath = [dataPath

Re: Audio Streaming with Cocoa

2010-10-25 Thread Jean-Daniel Dupas
Le 26 oct. 2010 à 00:36, Uli Kusterer a écrit : On 25.10.2010, at 16:10, Bilel Mhedhbi wrote: I want to practice and make my own radio player with Cocoa. I just want to know what are your ideas about how to get an audio stream across the internet (I already did something, but I want to

Re: init returns nil or raises exception?

2010-10-07 Thread Jean-Daniel Dupas
Le 7 oct. 2010 à 18:04, Kyle Sluder a écrit : On Thu, Oct 7, 2010 at 12:47 AM, Remco Poelstra re...@beryllium.net wrote: While still in the process of cleaning up my code, I read in the documentation of NSObject that -init should return nil if it fails to initialize. But a paragraph lower

Re: Efficiently adding a bunch of items to an NSMutableArray

2010-09-22 Thread Jean-Daniel Dupas
Le 22 sept. 2010 à 14:46, Oleg Krupnov a écrit : Hi, I have a NSMutableArray and need to add a number of elements to it, and their quantity I know in advance (in fact, they come from another array). I think that if I add them one-by-one in a loop, the array will have to reallocate its

Re: Another Icon Question

2010-08-24 Thread Jean-Daniel Dupas
Le 24 août 2010 à 17:57, Mark Ritchie a écrit : Hey! On 24/Aug/2010, at 7:43 AM, k...@highrolls.net wrote: I added CoreServices.framework to my project since it contains LaunchServices.framework. When I tried this, I had to explicitly include LaunchServices.framework The referenced

Re: warning: initialization from distinct Objective-C type

2010-08-21 Thread Jean-Daniel Dupas
Le 21 août 2010 à 23:52, k...@highrolls.net a écrit : How should I make the assignment to 'fm' below to get rid of this warning? warning: initialization from distinct Objective-C type /* drawWithFrame:inView */ - (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView

Re: NSBeep() is way too soft!

2010-08-12 Thread Jean-Daniel Dupas
Le 12 août 2010 à 16:58, McLaughlin, Michael P. a écrit : I have a new Mac Pro which is perfectly OK except that the NSBeep() function in my code (OS 10.6.4, Xcode 3.2.3) produces a beep (the default) that is almost too soft to hear. Other sounds through the internal speaker are fine. Is

Re: Looking for a FTP framework

2010-08-11 Thread Jean-Daniel Dupas
Le 11 août 2010 à 01:15, David Alter a écrit : I'm adding FTP support to a Mac application. It actually needs to support SFTP. I need to support upload and downloading. If a connection is dropped I need to be able to re-establish a connection and finish the operation. It looks like there

Re: Is this the correct way to cache an IMP?

2010-08-05 Thread Jean-Daniel Dupas
Le 5 août 2010 à 14:59, Graham Cox a écrit : I have a Obj-C method that is highly recursive, and needs to run at maximum performance. With this in mind, I am locally caching the method's own IMP to avoid the message dispatch for the recursive calls. It seems to work and gives a measurable

Re: Is this the correct way to cache an IMP?

2010-08-05 Thread Jean-Daniel Dupas
Le 5 août 2010 à 15:37, Graham Cox a écrit : On 05/08/2010, at 11:14 PM, Ken Thomases wrote: If you don't need to support subclassing and overriding of this method, just move its body to a function, and have the method be a thin wrapper around the function. The problem with that

Re: NSRunLoop's -runMode:beforeDate: not exiting after an NSTask finishes

2010-08-05 Thread Jean-Daniel Dupas
Le 5 août 2010 à 19:10, Jens Alfke a écrit : I’ve got a place in my code where I need to block waiting for an otherwise-asynchronous action to complete, so I use a fairly standard technique of running a nested runloop. But sometimes the runloop just keeps waiting forever even after the

Re: print object by %@

2010-07-22 Thread Jean-Daniel Dupas
Le 22 juil. 2010 à 13:32, Ariel Feinerman a écrit : Hi developers, I search in google, but can see nothing. Is there Cocoa fuction for objects like printf(), without timestamps? Not the most efficient way, but straightforward for debugging purpose: printf(%s, [[NSString

Re: print object by %@

2010-07-22 Thread Jean-Daniel Dupas
mean a function for console output, not for debugging like NSLog(), so I wish: NSLog(@object is %@, obj); // $ object is [object description] I would not wish to convert NSString to utf8 for printf(), I wish to use NSString 2010/7/22 Jean-Daniel Dupas devli...@shadowlab.org Le 22 juil

Re: Finding Application support folder without Cocoa or Carbon

2010-07-12 Thread Jean-Daniel Dupas
Le 12 juil. 2010 à 22:17, Alexander Cohen a écrit : Hello, I need to find the system Application Support folder without using either Carbon or Cocoa, i can use CoreFoundation though. Is there a way to do this? What prevent you to use CoreServices which is neither Carbon, nor Cocoa ?

Re: NSWorkspace iconForFile

2010-07-06 Thread Jean-Daniel Dupas
Le 6 juil. 2010 à 18:17, k...@highrolls.net a écrit : NSWorkspace iconForFile returns folder images for Documents, Desktop and Downloads. Where does one get the icon used by the Finder Places View for these paths? Not for me. It returns the expected icon: [[NSWorkspace sharedWorkspace]

Re: NSWorkspace iconForFile

2010-07-06 Thread Jean-Daniel Dupas
Le 6 juil. 2010 à 18:45, Kyle Sluder a écrit : On Tue, Jul 6, 2010 at 9:42 AM, Jean-Daniel Dupas devli...@shadowlab.org wrote: Not for me. It returns the expected icon: [[NSWorkspace sharedWorkspace] iconForFile:[@~/Desktop stringByStandardizingPath]] returns the desktop folder icon

Re: Custom bundle icon

2010-07-02 Thread Jean-Daniel Dupas
Le 2 juil. 2010 à 15:39, John Johnson a écrit : Just an aesthetic question. I've implemented an API for cocoa plugins in my app, and the plugins use a custom extension, ftplugin. These plugins show up as folders in the finder, even though I've set the app icon to an icns file. Is there

Re: Bypass Network System Preferences for DNS lookup

2010-07-02 Thread Jean-Daniel Dupas
Le 2 juil. 2010 à 19:33, Jens Alfke a écrit : On Jul 1, 2010, at 7:42 PM, Michael Jackson wrote: Is there any way to bypass the system network preferences for DNS servers to perform all DNS lookups from within a Cocoa app? For example, I would like my app to always make DNS queries to a

Re: class_respondsToSelector() in runtime.h?

2010-07-01 Thread Jean-Daniel Dupas
Le 1 juil. 2010 à 19:30, Jonathon Kuo a écrit : On Jul 1, 2010, at 9:49 AM, Kyle Sluder wrote: On Jul 1, 2010, at 9:42 AM, Jonathon Kuo newsli...@autonomy.caltech.edu wrote: On Jul 1, 2010, at 7:56 AM, Matt Neuburg wrote: Instance methods defined in a root class can be performed

Re: Best way to compare CGFloats

2010-06-30 Thread Jean-Daniel Dupas
Le 30 juin 2010 à 10:35, Rimas M. a écrit : Hello, I am stuck with floats (doubles, to be precise) comparison. In part of my app, I am dealing with NSPoint components (x, y) comparison. On 32bit architecture NSPoint components are floats, and direct comparison ( float1 == float2 ) works

Re: Best way to determine if a directory is a package

2010-06-24 Thread Jean-Daniel Dupas
Le 24 juin 2010 à 23:24, Ron Aldrich a écrit : Hello All, I've been asked to add the ability to drop a folder onto my application, and scan the folder for acceptable documents. I'd like to filter the scan such that any file which is contained within a package, or within a hidden folder

Re: File descriptors not freed up without a -closeFile call

2010-06-23 Thread Jean-Daniel Dupas
Le 23 juin 2010 à 12:14, Ben Haller a écrit : Hi all. I'm using NSTask and NSPipe to launch lots of little processes, and I'm running out of file descriptors. In my googling and archive searching, I found some info that led me to several approaches: 1. I ran ObjectAlloc and Leaks

Re: File descriptors not freed up without a -closeFile call

2010-06-23 Thread Jean-Daniel Dupas
Le 23 juin 2010 à 12:14, Ben Haller a écrit : So I have a workaround for the problem, but I want to understand *why* it works. Shouldn't NSPipe close its associated files when it deallocs? Why should it be necessary to call -closeFile? This behavior seems to be specifically

Re: File descriptors not freed up without a -closeFile call

2010-06-23 Thread Jean-Daniel Dupas
Le 23 juin 2010 à 12:47, Ben Haller a écrit : On 23-Jun-10, at 6:22 AM, Uli Kusterer wrote: Am Jun 23, 2010 um 12:14 PM schrieb Ben Haller: So I have a workaround for the problem, but I want to understand *why* it works. Shouldn't NSPipe close its associated files when it deallocs? Why

Re: terminates app when main window closes

2010-06-18 Thread Jean-Daniel Dupas
On Jun 18, 2010, at 2:02 AM, Kyle Sluder wrote: On Thu, Jun 17, 2010 at 11:41 PM, Angelo Chen angelochen...@yahoo.com.hk wrote: I have a non document based application, I quit the app by sending terminate to NSApplication(file owner). if I close the main window, application will not be

Re: Base class/subclass model in objective c

2010-06-18 Thread Jean-Daniel Dupas
Le 18 juin 2010 à 12:44, Jonny Taylor a écrit : I am still getting to grips with objective C, coming from a C++ background, and I'm stuck on a particular aspect of the base class/subclass model that I hope somebody can help me with. I need an object representing a video camera plugged

Re: Base class/subclass model in objective c

2010-06-18 Thread Jean-Daniel Dupas
Le 18 juin 2010 à 17:05, Jonny Taylor a écrit : Thanks for your reply Jean-Daniel. I can see two ways of working around this - either implement placeholder methods in the base class (that raise an exception or something) in order to make the base class conform to the protocol (knowing

Re: NSLog and va_list

2010-06-17 Thread Jean-Daniel Dupas
Le 17 juin 2010 à 14:21, Matt James a écrit : Hi everyone, Can anyone tell me how to NSLog() a va_list variable so I can see what's in it? You can't. va_list does not contains information about the type of variables it contains. -- Jean-Daniel

Re: NSRunLoop

2010-06-14 Thread Jean-Daniel Dupas
Le 15 juin 2010 à 00:22, Ariel Feinerman a écrit : Hi, I wish to make programme has cpu-related (one thread per core) number of worker threads. When user inputs the data, main thread splits up the data and send to the workers. Then worker threads go to sleep in anticipation of the next

Re: QuickTime web browser plugin - get current timecode

2010-06-08 Thread Jean-Daniel Dupas
Le 8 juin 2010 à 17:45, Paweł Kostecki a écrit : Hi all, Is there any possibility of getting a current timecode of a QuickTime video played on a web page (in QT plugin)? I mean a possibility similar to desktop [qtMovie currentTime] in Cocoa. What I need to do is to get a current

Re: BOOL returned via -performSelctor: not BOOL on 64-bit system

2010-06-08 Thread Jean-Daniel Dupas
Le 8 juin 2010 à 19:23, James Bucanek a écrit : Nick Zitzmann mailto:n...@chronosnet.com wrote (Tuesday, June 8, 2010 9:27 AM -0600): On Jun 8, 2010, at 10:16 AM, James Bucanek wrote: I've been trying to track down a peculiar bug reported by a customer, and I've narrowed it down to a

Re: BOOL returned via -performSelctor: not BOOL on 64-bit system

2010-06-08 Thread Jean-Daniel Dupas
Le 8 juin 2010 à 19:52, Alexander Heinz a écrit : On Jun 8, 2010, at 1:37 PM, Jean-Daniel Dupas wrote: Le 8 juin 2010 à 19:23, James Bucanek a écrit : Nick Zitzmann mailto:n...@chronosnet.com wrote (Tuesday, June 8, 2010 9:27 AM -0600): On Jun 8, 2010, at 10:16 AM, James Bucanek

Re: Debugging sporadic crashes

2010-06-07 Thread Jean-Daniel Dupas
Le 7 juin 2010 à 16:39, Gabriel Zachmann a écrit : I have an application with LSBackgroundOnly = on, and LSUIElement = off. Unfortunately, it crashes occasionally, or, rarely, it just hangs for a minute (with beach ball) then comes back to life. So far, I have been unable to find a case

Re: CFAttributedString and NSDATA

2010-06-03 Thread Jean-Daniel Dupas
Le 3 juin 2010 à 12:14, Chaitanya Pandit a écrit : It's really funny that the 3.2 SDk has incorporated the use of CFAttributedStrings, but its really funny theres no way to convert it to NSData and back. Does anyone have any idea about how to persist a CFAttributedString by converting it

Re: CFAttributedString and NSDATA

2010-06-03 Thread Jean-Daniel Dupas
Le 3 juin 2010 à 14:07, Kyle Sluder a écrit : On Jun 3, 2010, at 4:24 AM, Jean-Daniel Dupas devli...@shadowlab.org wrote: If it behaves as the Mac OS CFAttributedString, cast it into an NSAttributedString and use an archiver. Is NSAttributedString a public type in 3.2? Look like

Re: App will not launch

2010-06-01 Thread Jean-Daniel Dupas
Le 1 juin 2010 à 19:47, k...@highrolls.net a écrit : I have many customers and one is having a problem with my application not launching. The customer tells me that upon double-clicking the app just bounces in the Dock and never finishes launching. The customer must Force Quit. Since

Re: Notification of file system modification arrives too early?

2010-05-31 Thread Jean-Daniel Dupas
Le 31 mai 2010 à 05:39, Dave Keck a écrit : Unfortunately you probably can’t do any better than that, since there’s no cheap way to find out if another process has the file open. proc_listpidspath() is meant for this, but it is indeed quite expensive. In my testing, it takes about a second

Re: UTI strings

2010-05-31 Thread Jean-Daniel Dupas
Le 31 mai 2010 à 10:25, julius a écrit : On 31 May 2010, at 01:42, John Joyce wrote: On May 30, 2010, at 5:15 PM, julius wrote: John hi On 30 May 2010, at 19:47, John Joyce wrote: That's not how these constants work. These are intended to be constants that return the correct type

Re: UTI strings

2010-05-31 Thread Jean-Daniel Dupas
Le 31 mai 2010 à 10:53, julius a écrit : On 31 May 2010, at 09:43, Jean-Daniel Dupas wrote: This data is covered, but you may want to explore further the docs, a few books on cocoa, and sample apps from apple. Look at how they handle this. Ideally, look at open source or sample apps

Re: dynamic resolution

2010-05-31 Thread Jean-Daniel Dupas
You have to include objc runtime header to use runtime methods. #include objc/runtime.h Le 31 mai 2010 à 15:03, Rafael Cerioli a écrit : Hi, I guess you need the framework libobjc.A.dylib for that stuff. Rafael Le 31 mai 2010 à 08:45, Louis-Philippe a écrit : Hi, I am trying

Re: dynamic resolution

2010-05-31 Thread Jean-Daniel Dupas
Le 31 mai 2010 à 20:50, Rafael Cerioli a écrit : Le 31 mai 2010 à 13:41, Alastair Houghton a écrit : On 31 May 2010, at 14:03, Rafael Cerioli wrote: I guess you need the framework libobjc.A.dylib for that stuff. 1. That's a dylib (aka DLL, aka shared object), not a framework. Yes

Re: Notification of file system modification arrives too early?

2010-05-28 Thread Jean-Daniel Dupas
Le 28 mai 2010 à 12:53, Antonio Nunes a écrit : On 28 May 2010, at 11:41, Antonio Nunes wrote: I was hoping the system would provide something better for this. Looks like an enhancement request is in order. Request filed. Bug ID# 8038793: Need notification of file system modification

Re: subclass overwriting superclass ivar

2010-05-27 Thread Jean-Daniel Dupas
Le 27 mai 2010 à 13:53, jonat...@mugginsoft.com a écrit : On 26 May 2010, at 20:00, Greg Parker wrote: Mac or iPhone? iPhone device or iPhone simulator? 32-bit Mac or 64-bit Mac? Sorry for the vagueness. 32 bit mac. My guess is that (1) you're running on iPhone Simulator or

Re: subclass overwriting superclass ivar

2010-05-26 Thread Jean-Daniel Dupas
Le 26 mai 2010 à 14:53, Graham Cox a écrit : On 26/05/2010, at 10:41 PM, vincent habchi wrote: Hmmm... Let's say you have a class A with a private variable priv and b a pointer to a subclass of A. Is: [(A *)b priv] legal? No. It's not legal syntax for accessing an ivar in any

Re: subclass overwriting superclass ivar

2010-05-26 Thread Jean-Daniel Dupas
Le 26 mai 2010 à 15:00, Roland King a écrit : @interface A(MyCategory) -(void)someMethodWhichLegallyAccessesThePrivateVariablePriv; @end That's legal, I can write a category against an already-compiled class without having the source and without recompiling it and I can access any of

Re: subclass overwriting superclass ivar

2010-05-26 Thread Jean-Daniel Dupas
Le 26 mai 2010 à 15:10, vincent habchi a écrit : Le 26 mai 2010 à 14:53, Graham Cox a écrit : On 26/05/2010, at 10:41 PM, vincent habchi wrote: Hmmm... Let's say you have a class A with a private variable priv and b a pointer to a subclass of A. Is: [(A *)b priv] legal? No.

Re: send computer to sleep

2010-05-26 Thread Jean-Daniel Dupas
Le 26 mai 2010 à 23:01, Julian. a écrit : what is the correct way to send the computer to sleep? i couldn't find anything in the documentation, except appleevents... #include IOKit/pwr_mgt/IOPMLib.h void SystemSleep() { io_connect_t port = IOPMFindPowerManagement(MACH_PORT_NULL);

Re: Calling allObjects memory allocation problem

2010-05-21 Thread Jean-Daniel Dupas
Le 21 mai 2010 à 17:54, Keary Suska a écrit : On May 21, 2010, at 9:18 AM, Paul Sanders wrote: Also be aware that just because memory is released, doesn't mean it is returned to the system (e.g. you will not see your apps memory usage go down in Activity Monitor). In fact, AFAIK, it is

Re: Notifications on main thread

2010-05-18 Thread Jean-Daniel Dupas
Le 18 mai 2010 à 16:34, Jonny Taylor a écrit : Hi all, I have been programming on the mac for many years but have only just started trying to get the hang of cocoa. I have a particular question about NSNotification that I hope somebody will be able to help with. My code works with a

Re: Finder file label from cocoa?

2010-04-28 Thread Jean-Daniel Dupas
Le 28 avr. 2010 à 02:14, Rainer Standke a écrit : Hello, is there a way to get to the finder label of a file from Cocoa? I'd like to be able to get set them. To get and set it, you can probably use the NSURLLabelNumberKey property (introduced in 10.6) and the URL Resource API: -

Re: NSKeyedArchiver and NSPoints

2010-04-28 Thread Jean-Daniel Dupas
Le 28 avr. 2010 à 13:09, Graham Cox a écrit : On 28/04/2010, at 8:00 PM, Gerriet M. Denkmann wrote: // *** -[NSKeyedArchiver encodeValueOfObjCType:at:]: this archiver cannot encode structs Using NSArchiver (without the Keyed) works fine. How am I supposed to save my array

Re: NSKeyedArchiver and NSPoints

2010-04-28 Thread Jean-Daniel Dupas
Le 28 avr. 2010 à 21:45, Raffael Cavallaro a écrit : On Apr 28, 2010, at 3:31 PM, Quincey Morris wrote: So my original point stands: I want my original bit pattern back again after unarchiving, and I don't believe that a finite decimal string will guarantee that. As a practical

Re: Forcing plist preferences file to be saved as text?

2010-04-22 Thread Jean-Daniel Dupas
Le 22 avr. 2010 à 23:36, Laurent Daudelin a écrit : Is there any way to force the NSUserDefaults instances to save preferences of an application as a text-only plist file in 10.5 as it does on 10.6? For some reason, that seems to be happening only on 10.5. I don't think so. NSUserDefault

Re: Simple low memory warning?

2010-04-20 Thread Jean-Daniel Dupas
Le 20 avr. 2010 à 19:23, Bill a écrit : On Apr 20, 2010, at 10:17 AM, Nick Zitzmann wrote: On Apr 20, 2010, at 10:10 AM, Bill wrote: Does there exist a low-memory warning for Mac apps similar to the didReceiveMemoryWarning for the iPhone? I have looked at NSCache and other

Re: Simple low memory warning?

2010-04-20 Thread Jean-Daniel Dupas
Le 20 avr. 2010 à 19:36, Bill a écrit : On Apr 20, 2010, at 10:34 AM, Jean-Daniel Dupas wrote: Le 20 avr. 2010 à 19:23, Bill a écrit : On Apr 20, 2010, at 10:17 AM, Nick Zitzmann wrote: On Apr 20, 2010, at 10:10 AM, Bill wrote: Does there exist a low-memory warning for Mac

Re: Introspecting the current method

2010-04-19 Thread Jean-Daniel Dupas
Le 19 avr. 2010 à 04:21, Michael Ash a écrit : On Sun, Apr 18, 2010 at 10:15 PM, Dave DeLong davedel...@me.com wrote: Yes, code should obviously be written with this knowledge in mind. The use case I have for it is for macros. I like to use a debugging macro like the following to ensure

Re: blocks and autorelease weirdness

2010-04-19 Thread Jean-Daniel Dupas
Le 19 avr. 2010 à 11:35, Henk Kampman a écrit : Have a look at the following code -(void) test { testString = NULL; dispatch_async(dispatch_get_global_queue(0, 0), ^{ dispatch_async(dispatch_get_main_queue(), ^{

Re: Introspecting the current method

2010-04-19 Thread Jean-Daniel Dupas
Le 19 avr. 2010 à 20:54, Greg Parker a écrit : On Apr 18, 2010, at 7:01 PM, Ken Thomases wrote: On Apr 18, 2010, at 7:14 PM, Dave DeLong wrote: If I'm inside a method, is there a way to know at runtime whether that method is a class or an instance method? Keep in mind that class methods

Re: Weird CGFloat issue

2010-04-18 Thread Jean-Daniel Dupas
Le 18 avr. 2010 à 19:26, Gideon King a écrit : Hi all, I'm having a really strange problem with a simple method call: CGFloat newMin = 150.0f; CGFloat newMax = 0.0f; [mapContentSubview setMinDimension:newMin andMaxDimension:newMax]; The method is defined as: -

Re: Zeroing out instance variables

2010-04-17 Thread Jean-Daniel Dupas
Le 17 avr. 2010 à 16:16, Ken Thomases a écrit : On Apr 17, 2010, at 8:53 AM, Paul Sanders wrote: Something I've never been clear about though is where an object's retain count is stored. This obviously requires an iVar somewhere (in addition to isA), so there might be a trap for the

Re: base64Binary

2010-04-14 Thread Jean-Daniel Dupas
Google provide some class to do that too. See GTMBase64 classes at http://code.google.com/p/google-toolbox-for-mac/source/browse/#svn/trunk/Foundation Le 14 avr. 2010 à 22:00, joby abraham a écrit : Hi Bialecki, for base64 encoding/decoding you can use openSSL Library which providing by

Re: base64Binary

2010-04-14 Thread Jean-Daniel Dupas
libcrypto). Le 14 avr. 2010 à 22:58, joby abraham a écrit : Hi Bialecki, It always better use library which provided by MAC OS. Thanks regards, Joby Abraham. On Thu, Apr 15, 2010 at 02:17, Jean-Daniel Dupas devli...@shadowlab.org wrote: Google provide some class to do that too. See

Re: CIContext in 10.6

2010-04-12 Thread Jean-Daniel Dupas
Le 12 avr. 2010 à 16:39, Gerriet M. Denkmann a écrit : This works (but is deprecated in 10.6): NSOpenGLPixelFormat *pixelFomat = CGLPixelFormatObj b = [ pixelFomat CGLPixelFormatObj ]; CGLContextObj a = CGLGetCurrentContext();

Re: OS X Game Programming

2010-04-07 Thread Jean-Daniel Dupas
Most basics OpenGL sample codes on ADC handle keyboard events. For instance, first Google result for Cocoa OpenGL http://developer.apple.com/mac/library/samplecode/CocoaGL/Introduction/Intro.html Le 7 avr. 2010 à 09:34, Pascal Harris a écrit : I've never programmed games before, although

Re: Alternative startup for application

2010-04-06 Thread Jean-Daniel Dupas
Le 3 avr. 2010 à 05:13, Michael Nickerson a écrit : On Apr 02, 2010, at 10:12 PM, Gideon King wrote: That's the instance method. New in 10.6 is the class method of the same name, which is what I need in this case, since I don't have an event to work with. On 03/04/2010, at 12:09 PM,

Re: How do I get a file reference w/o relying on the path?

2010-04-06 Thread Jean-Daniel Dupas
Le 4 avr. 2010 à 19:50, Jens Alfke a écrit : You're saying that if I have a FSRef to a file, then the file is moved, the FSRef will still reference the moved file and not the location where it used to be? That's surprising to me, because FSRefs were created as a replacement for

Re: Copy Folder Attributes of /dev

2010-04-01 Thread Jean-Daniel Dupas
Le 1 avr. 2010 à 19:54, gMail.com a écrit : Hi, I want to copy all the folder's attributes, so instead of using the Cocoa API I have to use FSSetCatalogInfo. This requires an FSRef, so I use FSPathMakeRef or FSPathMakeRefWithOptions, e.g. err = FSPathMakeRefWithOptions((UInt8*)cSrcPath,

Re: Terminating subtasks reliably

2010-03-31 Thread Jean-Daniel Dupas
Le 31 mars 2010 à 05:18, John Harte a écrit : On Mar 30, 2010, at 4:01 PM, McLaughlin, Michael P. wrote: I have a Cocoa app (Leopard) which launches several Foundation Tool subtasks (since threads are not sufficient in this case). Currently, I terminate these subtasks via the

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