Re: My try/catch block isn't catching exceptions on 10.6

2009-11-30 Thread Kai Brüning
On 28.11.2009, at 13:57, Gwynne Raskind wrote: On Nov 28, 2009, at 4:25 AM, Greg Parker wrote: Here's a fun idiom for handling both C++ and Objective-C exceptions in the same place (on iPhone and 64-bit Mac). @try { // do stuff } @catch (NSException *e) { // NSException

Re: troubles with tableview

2009-11-30 Thread Graham Cox
On 30/11/2009, at 7:21 PM, Dorimedont Bancescu wrote: -why in initWithCoder the array is loaded, has all the elements and when numberOfRowsInTableView message is send the array is empty and has a different memory address? Probably because you have two distinct objects. Check the address

NSWorkspace in a daemon

2009-11-30 Thread Nyxouf da ouf
Hi, I have an Obj-c program who run as a daemon, using launchd, and that look for NSWorkspaceDidMountNotification. *[[[NSWorkspace sharedWorkspace] notificationCenter] addObserver:self selector:@selector(diskDidMount:) name:NSWorkspaceDidMountNotification object:nil];*

Re: Apache Module

2009-11-30 Thread Sherm Pendley
On Sat, Nov 28, 2009 at 1:19 PM, Mr. Gecko grmrge...@gmail.com wrote: Ok, I know your idea of a CGI Proxy like PHP CGI That's not what I said. Did you read the link I gave you? On Nov 28, 2009, at 9:32 AM, Sherm Pendley wrote: Keep in mind though, that I posted that nearly five years ago,

Hiding String Constant in Compiled Code

2009-11-30 Thread Richard Somers
Consider a string constant, @string, in source code that also appears in the compiled unix executable file. If someone knew the value of the string they could easily open the executable with TextEdit, find the string, replace it with a perfectly functioning one of their own making, and

Re: NSWorkspace in a daemon

2009-11-30 Thread Bill Garrison
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] addObserver:self selector:@selector(diskDidMount:)

Re: NSWorkspace in a daemon

2009-11-30 Thread Nyxem
I found something that said to use NSApplicationLoad() and it seems to work. Nyxem. On Nov 30, 2009, at 4:25 PM, Bill Garrison wrote: 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

Re: NSWorkspace in a daemon

2009-11-30 Thread Dave DeLong
While it may solve your problem, that's probably not a good idea. NSApplicationLoad() loads the AppKit framework and its dependencies (like Input Managers), which (when running as root) introduce a mess of security vulnerabilities into your program (attackers can use your app to gain root

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] addObserver:self

Re: NSWorkspace in a daemon

2009-11-30 Thread Nyxem
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 : 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

AudioToolbox Pitch Bend?

2009-11-30 Thread Chunk 1978
is it possible to bend the pitch of a sound using AudioToolbox? how can i accomplish a pitch bend of a live running sound? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Re: Apache Module

2009-11-30 Thread Jens Alfke
On Nov 30, 2009, at 8:48 AM, Mr. Gecko wrote: I decided to write it like PHP CGI, it's working fine for me, and I'm able to get all the information I need from the server by NSFileHandle and NSProcessInfo. Cool. If you find that performance is a problem, you should look into using SCGI.

Re: AudioToolbox Pitch Bend?

2009-11-30 Thread Jens Alfke
On Nov 30, 2009, at 9:04 AM, Chunk 1978 wrote: is it possible to bend the pitch of a sound using AudioToolbox? Nope. For that you need to use AudioUnits; there's a built-in unit that will do time/pitch shifting. how can i accomplish a pitch bend of a live running sound? Basically you'd

Re: Hiding String Constant in Compiled Code

2009-11-30 Thread Matt Neuburg
On Mon, 30 Nov 2009 07:48:42 -0700, Richard Somers rsomers.li...@infowest.com said: Consider a string constant, @string, in source code that also appears in the compiled unix executable file. If someone knew the value of the string they could easily open the executable with TextEdit, find the

Re: AudioToolbox Pitch Bend?

2009-11-30 Thread Chunk 1978
thanks. i'm going to check out apple's iPhoneMultichannelMixerText sample code. i assume the sample code shows how to change volume for each track (audio-in / volume / audio-out), so i'm hoping replacing volume for a pitch shift won't be too difficult.. On Mon, Nov 30, 2009 at 12:14 PM, Jens

Re: Hiding String Constant in Compiled Code

2009-11-30 Thread Jens Alfke
On Nov 30, 2009, at 9:23 AM, Matt Neuburg wrote: If the app is code-signed, it will not run when the executable is altered. In which case, the hacker just needs to strip the signature. If your code checks for a signature, the hacker can re-sign it with his own. If your code checks for your key

Re: Hiding String Constant in Compiled Code

2009-11-30 Thread Richard Somers
On Nov 30, 2009, at 10:23 AM, Matt Neuburg wrote: If the app is code-signed, it will not run when the executable is altered. I could be wrong but I do not think this is the case. The documentation states Once you have signed your code, any change in the code that you did not

removing all sublayers from a layer with fast enumeration

2009-11-30 Thread Matt Neuburg
To remove all sublayers from a layer, it is sufficient to set that layer's sublayers property to nil, so this code is completely unnecessary. But I'm just curious as to why it doesn't work: for (CALayer* sub in myview.layer.sublayers) [sub removeFromSuperlayer]; This crashes as if the fast

How duplicate the text color of Apple's labels in UITableView cells

2009-11-30 Thread Steve Fogel
Hi, all... In various places in my app, I'd like to create labels that have the same color, weight, and font size as the labels in default UITableView cells. For example, I'd like to duplicate the appearance, especially the color, of the textLabel and the detailTextLabel of the table cell with

Does NSData rearrange the order of bits?

2009-11-30 Thread Brad Gibbs
Hi, I'm doing bit-packing via a C function. Logging the bits of the C function shows the expected result. If I create a string with a hex value format, I get the correct hex string, but, if I try to put the bytes into an NSData object with [NSData dataWithBytes: length], the order of the

Re: removing all sublayers from a layer with fast enumeration

2009-11-30 Thread David Duncan
Your modifying an array that is being enumerated, which is illegal. -- David Duncan @ My iPhone On Nov 30, 2009, at 2:23 PM, Matt Neuburg m...@tidbits.com wrote: To remove all sublayers from a layer, it is sufficient to set that layer's sublayers property to nil, so this code is completely

Re: removing all sublayers from a layer with fast enumeration

2009-11-30 Thread Nick Zitzmann
On Nov 30, 2009, at 12:23 PM, Matt Neuburg wrote: To remove all sublayers from a layer, it is sufficient to set that layer's sublayers property to nil, so this code is completely unnecessary. But I'm just curious as to why it doesn't work: for (CALayer* sub in myview.layer.sublayers)

Re: removing all sublayers from a layer with fast enumeration

2009-11-30 Thread Matt Neuburg
On or about 11/30/09 11:33 AM, thus spake David Duncan david.dun...@apple.com: Your modifying an array that is being enumerated, which is illegal. I thought of that, of course, but I doubted that could be the reason, because I changed the code to look like this: NSArray* arr = [NSArray

Re: removing all sublayers from a layer with fast enumeration

2009-11-30 Thread Dave Keck
Is the crash due to an exception? Is anything printed to stdout? I'll go out on a limb and say your view is layer-backed instead of layer-hosted... ? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Behavior of CFStringUpper/Lowercase for NULL Locale?

2009-11-30 Thread Jim Correia
The documentation for CFStringUppercase says: locale A CFLocale object that specifies a particular language or region. Prior to Mac OS X v10.3, this parameter was an untyped pointer and not used. The locale argument affects

Re: Does NSData rearrange the order of bits?

2009-11-30 Thread Jens Alfke
On Nov 30, 2009, at 11:27 AM, Brad Gibbs wrote: I'm doing bit-packing via a C function. Logging the bits of the C function shows the expected result. If I create a string with a hex value format, I get the correct hex string, but, if I try to put the bytes into an NSData object with

Re: Does NSData rearrange the order of bits?

2009-11-30 Thread Brad Gibbs
I guess it is. I had another issue that was preventing the code from working properly. Another list member mailed me an explanation offline, causing me to look for and find the real problem preventing my code from running. Thanks for the response. On Nov 30, 2009, at 12:22 PM, Jens Alfke

Re: Does NSData rearrange the order of bits?

2009-11-30 Thread Peter Duniho
On Nov 30, 2009, at 11:27 AM, Brad Gibbs wrote: Hi, I'm doing bit-packing via a C function. Logging the bits of the C function shows the expected result. If I create a string with a hex value format, I get the correct hex string, but, if I try to put the bytes into an NSData object

iterating and removing objects from a collection

2009-11-30 Thread Dennis Munsie
On a related, yet different note... I run into this all the time where I need to iterate through an NSMutableArray (or set, etc, etc) and remove some of the items. My normal pattern has been this: NSMutableSet *removeSet = [[NSMutableSet alloc] init]; for(NSObject *foo in myArray) {

Re: Keyword @defs

2009-11-30 Thread Dennis Munsie
Not that I'm advocating it, but you can also declare a field as @public to allow you to access it via the - operator. Of course, I could be missing some compiler magic going on behind the scene as well, and it may not actually be the same speed wise as @defs was. Not to mention that it's just

Re: Keyword @defs

2009-11-30 Thread Bill Bumgarner
On Nov 30, 2009, at 12:50 PM, Dennis Munsie wrote: Not that I'm advocating it, but you can also declare a field as @public to allow you to access it via the - operator. Of course, I could be missing some compiler magic going on behind the scene as well, and it may not actually be the

Re: Core Data - any way to back it with something other than SQLite 3?

2009-11-30 Thread Barry Wark
You might take a look at the BaseTen framework (http://basetenframework.org/). It claims to be a Core Data-like API on top of PostgreSQL. I haven't used it myself but have been following the project. On Thu, Nov 26, 2009 at 6:53 PM, William Squires wsqui...@satx.rr.com wrote: Hi all!  Is there

Re: iterating and removing objects from a collection

2009-11-30 Thread Ken Thomases
On Nov 30, 2009, at 2:45 PM, Dennis Munsie wrote: I run into this all the time where I need to iterate through an NSMutableArray (or set, etc, etc) and remove some of the items. My normal pattern has been this: NSMutableSet *removeSet = [[NSMutableSet alloc] init]; for(NSObject *foo in

Re: Keyword @defs

2009-11-30 Thread Ben Haller
On 30-Nov-09, at 4:06 PM, Bill Bumgarner wrote: On Nov 30, 2009, at 12:50 PM, Dennis Munsie wrote: Not that I'm advocating it, but you can also declare a field as @public to allow you to access it via the - operator. Of course, I could be missing some compiler magic going on behind the

Re: iterating and removing objects from a collection

2009-11-30 Thread Sherm Pendley
On Mon, Nov 30, 2009 at 4:21 PM, Ken Thomases k...@codeweavers.com wrote: On Nov 30, 2009, at 2:45 PM, Dennis Munsie wrote: Some alternatives: * Iterate over the array just using an index, rather than fast enumeration (or NSEnumerator). A safe way to do that is to iterate backwards,

Re: Keyword @defs

2009-11-30 Thread Greg Parker
On Nov 30, 2009, at 1:33 PM, Ben Haller wrote: On 30-Nov-09, at 4:06 PM, Bill Bumgarner wrote: On Nov 30, 2009, at 12:50 PM, Dennis Munsie wrote: Not that I'm advocating it, but you can also declare a field as @public to allow you to access it via the - operator. Of course, I could be

[MEET] December CocoaHeads Mac Developer Meetings

2009-11-30 Thread Stephen Zyszkiewicz
Greetings, CocoaHeads is an international Mac programmer's group. Meetings are free and open to the public. We specialize in Cocoa, but everything Mac programming related is welcome. Upcoming meetings: Australia Sydney- Thursday, December 3, 2009 18:30. Austria Wien- Thursday, December

Re: Keyword @defs

2009-11-30 Thread Mike Abdullah
On 30 Nov 2009, at 21:33, Ben Haller wrote: On 30-Nov-09, at 4:06 PM, Bill Bumgarner wrote: On Nov 30, 2009, at 12:50 PM, Dennis Munsie wrote: Not that I'm advocating it, but you can also declare a field as @public to allow you to access it via the - operator. Of course, I could be

Re: Button width should accomodate localized string

2009-11-30 Thread Ricky Sharp
On Nov 29, 2009, at 9:52 AM, glenn andreas wrote: On Nov 29, 2009, at 9:38 AM, Symadept wrote: How can I scale my button or Label to be able to accomodate the localized string? That's the whole purpose of being able to localize the nib/xib... Exactly. It's not possible to create a

Re: Polymorphic relationship and migration

2009-11-30 Thread Yi Lin
Quincey, Thanks for the response. Shape is just a made-up example, but we can say the entity that contains shape is Diagram for the purpose of discussion. I am not sure what the mapping DiagramToShape would do. Here's my problem in more concrete terms. Let's say I have the entity mapping

Re: iterating and removing objects from a collection

2009-11-30 Thread Jens Alfke
On Nov 30, 2009, at 1:37 PM, Sherm Pendley wrote: A safe way to do that is to iterate backwards, starting at the max index and counting down to 0. That way, removing the item at the current index will only change the indexes of the items you've already +1. I often use this idiom. You can do

Re: Button width should accomodate localized string

2009-11-30 Thread Jens Alfke
On Nov 30, 2009, at 2:53 PM, Ricky Sharp wrote: Exactly. It's not possible to create a single nib such that its layout and control sizes will be appropriate for every language. It's not impossible, it's just that it requires a very different approach, which in turn makes it a lot harder to

Re: Polymorphic relationship and migration

2009-11-30 Thread Quincey Morris
On Nov 30, 2009, at 14:56, Yi Lin wrote: Let's say I have the entity mapping DiagramToDiagram. And one of the property mappings is shape. In the Relationship Mapping panel (the third column in the mapping model GUI), I set the KeyPath to $source.shape. The question is what to put in the

Re: Keyword @defs

2009-11-30 Thread Ben Haller
On 30-Nov-09, at 5:52 PM, Mike Abdullah wrote: On 30 Nov 2009, at 21:33, Ben Haller wrote: What I want is essentially a struct with methods; I need super-fast access to ivars for clients of the class in some places in my code. But I also want functionality provided by the class itself

copyWithZone - if anyone could explain this to me ?

2009-11-30 Thread Mario Kušnjer
Hi ! I have some trouble understanding this implementation: - copyWithZone:(NSZone *)zone { ImageAndTextCell *cell = (ImageAndTextCell *)[super copyWithZone:zone]; cell-image = [image retain]; return cell; } It is from the Apple's sample code. First question is why there is no

Re: removing all sublayers from a layer with fast enumeration

2009-11-30 Thread Matt Neuburg
On Mon, 30 Nov 2009 14:45:04 -0500, Dave Keck davek...@gmail.com said: Is the crash due to an exception? Is anything printed to stdout? No, that's part of what's so weird. If we were going to throw an exception, I'd expect to see a coherent explanation in the log. However, the call chain does

Re: copyWithZone - if anyone could explain this to me ?

2009-11-30 Thread Clark Cox
2009/11/30 Mario Kušnjer mario.kusn...@sb.t-com.hr: Hi ! I have some trouble understanding this implementation: - copyWithZone:(NSZone *)zone {    ImageAndTextCell *cell = (ImageAndTextCell *)[super copyWithZone:zone];    cell-image = [image retain];    return cell; } It is from the

RE: copyWithZone - if anyone could explain this to me ?

2009-11-30 Thread Jeff Laing
In most cases, yes. However, copyWithZone: is special, the superclass' implementation just blindly copies all of the raw bits in the source object to the newly created one. If you were to use the normal -setImage: call, that old value would be released one too many times. Assigning to the

Re: copyWithZone - if anyone could explain this to me ?

2009-11-30 Thread Mario Kušnjer
cell-image is semantically identical to (*cell).image. That is, it's directly accessing the instance variable image of the object cell This part is what trouble's me. cell-image = [image retain]; This could not be like this, right ? [cell image] = [image retain]; Mario Kušnjer

totally baffled by odoc apple event failing on launch

2009-11-30 Thread David M. Cotter
Coca64 only: recently our app has stopped responding to odoc apple events on startup. that is, if the user double clicks a document of our app, and this causes the app to launch, then the document is not opened. (cnr when app is already launched). same story dropping the doc icon onto the

Re: copyWithZone - if anyone could explain this to me ?

2009-11-30 Thread Graham Cox
On 01/12/2009, at 12:26 PM, Jeff Laing wrote: In most cases, yes. However, copyWithZone: is special, the superclass' implementation just blindly copies all of the raw bits in the source object to the newly created one. If you were to use the normal -setImage: call, that old value would be

Some questions/problems regarding CALayers

2009-11-30 Thread Henri Häkkinen
Hello. I'm trying to implement my custom NSView derived class to draw a chessboard with chess pieces on it. I'm using Core Animation's CALayer classes since I want to use animation with other effects later on. Currently I have have Board and Piece classes, which both derive from CALayer.

Re: copyWithZone - if anyone could explain this to me ?

2009-11-30 Thread Graham Cox
On 01/12/2009, at 12:30 PM, Mario Kušnjer wrote: This could not be like this, right ? [cell image] = [image retain]; No, because [cell image] returns a value, it does not set a value. You might consider doing this though: [cell setImage:image]; Clark is right that if the copy was a

NSAffineTransform scaleBy not scaling

2009-11-30 Thread Shane
Hey all, I'm drawing a graphing line, looks like a wave within an NSView. The line looks fine, except that it's not scaled to the size of the window. So my problem is trying to figure out how to scale it to the window size and every time that the window is resized. I currently have something

Re: totally baffled by odoc apple event failing on launch

2009-11-30 Thread David M. Cotter
i see theres this NSAppleEventManager, and that with that you can suspend an event and resume it later. i think this is what i want. but how do I get my app to force all these events to get sent (and therefore handled) on demand (before i go thru loading all the startup stuff)? i can only

Re: NSAffineTransform scaleBy not scaling

2009-11-30 Thread Stephen J. Butler
On Mon, Nov 30, 2009 at 7:55 PM, Shane software.research.developm...@gmail.com wrote: Anyone see what I'm doing wrong here, or know how to get the NSBezierPath to take up 90% of my NSView (leaving 10% blank for borders which is what I tried to do below)? You call concat before you apply the

Re: NSAffineTransform scaleBy not scaling

2009-11-30 Thread Graham Cox
On 01/12/2009, at 12:55 PM, Shane wrote: I'm drawing a graphing line, looks like a wave within an NSView. The line looks fine, except that it's not scaled to the size of the window. So my problem is trying to figure out how to scale it to the window size and every time that the window is

Re: Hiding String Constant in Compiled Code

2009-11-30 Thread Rob Keniger
On 01/12/2009, at 4:05 AM, Richard Somers wrote: I could be wrong but I do not think this is the case. The documentation states Once you have signed your code, any change in the code that you did not intend—whether introduced accidently or by hackers—can be detected by the system. No

Re: copyWithZone - if anyone could explain this to me ?

2009-11-30 Thread Mario Kušnjer
Thank you for your explanations, Clark, Jeff and Graham. I think i will go now and read a C book (yes, I know I should have read it by now) because it seems to me I have been missing something. Bye Mario Kušnjer mario.kusn...@sb.t-com.hr +385957051982

Re: totally baffled by odoc apple event failing on launch

2009-11-30 Thread Dave Keck
I'd imagine NSApp's delegate method -application:openFile: is what you should be using, unless there's a reason you need to handle the raw Apple event. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

Carbon menus in Cocoa app

2009-11-30 Thread Vikram Sethi
Hi, I have a Carbon app that I am moving to Cocoa. In an attempt to do that, I wrote code similar to this in the main function: [NSApplication sharedApplication]; … … [NSApp run]; All the event handling in currently Carbon based. I was expecting problems but after the changes, the app

What to subclass in NSArrayController to enable immediate editing of added rows?

2009-11-30 Thread David Hirsch
I have read about this online, but I can't find a solution that (a) works and (b) seems wise. I'm trying to have my table immediately enable editing of added items. The NSTableView is bound to an NSArrayController. I've subclassed NSArrayController, and tried this first: -

Re: NSAffineTransform scaleBy not scaling

2009-11-30 Thread Shane
Just adding the other methods for clarification. - (void) drawAxes:(NSRect) rect { NSRect bounds = [self bounds]; NSBezierPath *path = [NSBezierPath bezierPath]; [path moveToPoint:NSMakePoint(0.1, 0.0)]; [path

Re: How to draw text to bitmap (array) with pre 10.5 libs

2009-11-30 Thread Glenn McCord
Thanks for all the feedback guys. I got it to work using the NSString drawWithRect. For the sake of all those who stumble across this thread, the code used (minus lots of font and string code) is as follows... unsigned char* bitmapData = 0;

Re: copyWithZone - if anyone could explain this to me ?

2009-11-30 Thread Clark S. Cox III
Sent from my iPhone On Nov 30, 2009, at 17:26, Jeff Laing jeff.la...@spatialinfo.com wrote: In most cases, yes. However, copyWithZone: is special, the superclass' implementation just blindly copies all of the raw bits in the source object to the newly created one. If you were to use the

Re: NSAffineTransform scaleBy not scaling

2009-11-30 Thread Graham Cox
On 01/12/2009, at 3:21 PM, Shane wrote: I'm trying to keep the stroke path the same size, even thought I resize and scale the entire NSBezierPath to the view size. Having a little trouble figuring out how to do this. Instead of concatenating your transform to the current graphics context,

RE: copyWithZone - if anyone could explain this to me ?

2009-11-30 Thread Jeff Laing
Why would you not just do: [cell-image retain]; That makes it a lot clearer to me - since it was a bitwise copy, cell-image and image are identical values whereas the assignment looks like you are changing something. Because it may *not* have been a bitwise copy. The superclass

Re: totally baffled by odoc apple event failing on launch

2009-11-30 Thread David M. Cotter
yes i have that method. i'm just saying it is not being called in this case. the event is never received by the app on startup. if i double click the icon AFTER startup, it works fine. On Nov 30, 2009, at 6:50 PM, Dave Keck wrote: I'd imagine NSApp's delegate method -application:openFile: is

Re: copyWithZone - if anyone could explain this to me ?

2009-11-30 Thread Clark Cox
On Mon, Nov 30, 2009 at 9:57 PM, Jeff Laing jeff.la...@spatialinfo.com wrote: Why would you not just do:    [cell-image retain]; That makes it a lot clearer to me - since it was a bitwise copy, cell-image and image are identical values whereas the assignment looks like you are