linking the same static library into two places

2011-07-07 Thread Kenny Leung
Hi All. Hopefully somebody can help me with this: I have a static library with utilities that I like to use everywhere (it's a static library because we use it on iPhone as well). So I link it in with a framwork that I'm writing, and also link it in with an application that uses that framework

forcing accessibility focus

2010-11-12 Thread Kenny Leung
Hi All. I'm working on accessibility in an app, and would like to have a view pop up on screen and immediately become the focused item so that its text will be spoken. There seems to be no call to "becomeAccessibilityFocus" like there is "becomeFirstResponder". Is there a way to do this? Any

How to do cancellable HTTP request using CFNetwork APIs

2010-05-08 Thread Kenny Leung
Hi All. I'm using CFNetwork APIs to create a cancellable web operation using the synchronous, non-blocking APIs like so: do { bytesRead = 0; if ( CFReadStreamHasBytesAvailable(inStream) ) { bytesRead = CFReadStreamRead(inStream, buffer, sizeof(buffer)); if ( bytesRea

Re: Defining and using constants in Objective C

2009-11-29 Thread Kenny Leung
Hi Tharindu. I would create two files: Constants.h and Constants.m. Just like all C code, you put your declarations in the .h and the definitions in the .m. They are going to be very similar, except the .m defines the values, so it only happens once. This is very important if you want to be abl

Re: alloc/release confusion

2009-02-13 Thread Kenny Leung
It's all detailed here: http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html -Kenny ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact t

problem with [NSImage drawAtPoint:fromRect:operation:fraction:]

2008-10-22 Thread Kenny Leung
Hi All. I just want to check with the populous to make sure I have not gone stupid or insane. The documentation for [NSImage drawAtPoint:fromRect:operation:fraction:] states: "The image content is drawn at its current resolution and is not scaled unless the CTM of the current coordinate s

Re: Calling an object from a C function

2008-08-19 Thread Kenny Leung
Example: void cFunction(MyObject *myObject) { int myInt; int result; myInt = initializeMyInt(); result = [myObject myMethod:myInt]; printf("result:%i", result); } On Aug 19, 2008, at 4:28 PM, Charlie Dickman wrote: What is the syntax? For example, how do I invoke the metho

Re: Calling an object from a C function

2008-08-19 Thread Kenny Leung
Hi Gilbert. You just have to make sure that your C function is in a .m file (not a .c file) and have the proper header included. Then you just call the method. -Kenny On Aug 19, 2008, at 2:53 PM, Gilbert Mackall wrote: I have a C function from which I would like to call a method. I

Re: How to get a message when RETURN is pressed in a NSTextField

2008-06-24 Thread Kenny Leung
Hi Markus. Maybe you can become the delegate of the field editor instead then. -Kenny On Jun 23, 2008, at 11:41 PM, Markus Spoettl wrote: Hi Kenny, On Jun 23, 2008, at 9:39 PM, Kenny Leung wrote: NSTextField is a single-line entry control, so it wants to end editing when you hit return

Re: How to get a message when RETURN is pressed in a NSTextField

2008-06-23 Thread Kenny Leung
Hi Markus. NSTextField is a single-line entry control, so it wants to end editing when you hit return. In order to be notified, you should wire up its target outlet to be your controller and wire up its action to be an action method in your controller. If you are not familiar with target-

Re: Adding Categories to NSMutableData

2008-05-29 Thread Kenny Leung
Hi Rob. Looks like you've added the category to NSMutableData, but you're talking to an NSData. -Kenny On May 29, 2008, at 10:59 AM, Robert Kukuchka wrote: Hello, I'm trying to add a simple category to NSMutableData, but when I try to call my method I'm getting "*** -[NSConcreteData

Re: Group rotation

2008-05-07 Thread Kenny Leung
Hmmm... I'm just talking out loud here, but wouldn't it work to have a group model object whose drawing function is to concatenate its transform to the CTM then tell all the objects within the group to draw? Then all objects inside the group just do their drawing normally. -Kenny On May

looking for sample code to read UUID from a disk volume.

2008-04-09 Thread Kenny Leung
Hi All. I can see from diskutil that a volume has a UUID: [EMAIL PROTECTED]>diskutil info / Device Node:/dev/disk0s3 Device Identifier: disk0s3 Mount Point:/ Volume Name:Tiger File System:Journaled HFS+ Journal size 16384 k

Re: Image Processing

2008-04-07 Thread Kenny Leung
If you ask an NSImage for its size, the DPI in the image is taken into account. You can ask for pixelsHigh and pixelsWide in order to get the number of pixels. -Kenny On Apr 6, 2008, at 1:40 PM, Lorenzo wrote: Still working with image-processing... I have a source image 1680 x 1050 with (j

Re: Southern California Coders?

2008-04-03 Thread Kenny Leung
At one point, a fair number of San Diego folks drove up for the Lake Forest meetings. The drive got to them about a year ago, and I have not heard whether they have started their own group. It's definitely pretty lonely being a Cocoa developer in San Diego. I would like to help start a gr

Re: machine with null serial number?

2008-03-28 Thread Kenny Leung
This is a G5 machine, so it must be new enough. Maybe it has been in for repairs. Thanks for the tip! -Kenny On Mar 28, 2008, at 3:33 PM, Horst Hösel wrote: Hi All. I am working on a software licensing system that keys itself to the serial # of a particular machine. This has been working

machine with null serial number?

2008-03-28 Thread Kenny Leung
Hi All. I am working on a software licensing system that keys itself to the serial # of a particular machine. This has been working fine, except we bumped into a machine with no serial #. It even shows as a blank on Apple System Profiler. Has anybody bumped into this, or know the reason w