Re: Inconsistent results from iconForFile

2009-11-28 Thread Sandy McGuffog
Jens, Thanks - QuickLook does indeed consistently give the same previews as Finder. Problem solved! Regards, Sandy On Nov 28, 2009, at 8:41 AM, Jens Alfke wrote: > > On Nov 27, 2009, at 10:31 PM, Sandy McGuffog wrote: > >> For some files, I get a thumbnail of the file, so e.g., for a JPEG,

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

2009-11-28 Thread Greg Parker
On Nov 27, 2009, at 1:14 AM, Matt Gough wrote: The equivalent in Obj-c would be : @try { ... } @catch( NSException* e) { // deal with NSException } @catch(id ue) { // deal with any other sort of exception } There's also `...@catch (...)` in Objective-C. On iPhone and 64-bit Mac, `...@catch (.

Re: Apache Module

2009-11-28 Thread Graham Cox
On 28/11/2009, at 5:21 PM, Jens Alfke wrote: > like building a machine shop in your garage instead of just going to Home > Depot. I do have a machine shop in my garage, you insensitive clod! --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.app

Re: Transparency Help 2

2009-11-28 Thread Uli Kusterer
On 23.11.2009, at 19:01, R T wrote: > Given: A litho Image, Black & White pixels only. > I want to show just the Black Pixels in a subclassed NSView. Use CoreGraphics. The CGxxx APIs let you set a mask on the current graphics context. Essentially you get a CGImage from your NSImage, specify that

[SOLVED] Re: Sheet comes up disabled on second showing

2009-11-28 Thread Graham Cox
On 27/11/2009, at 12:32 PM, Graham Cox wrote: > I have a straightforward sheet containing a table and some buttons. First > time I show it, it comes up fine and works as it should. All subsequent > times, the whole interface is disabled except for the default button, so I > can close it but I

Cast NSNumber to int

2009-11-28 Thread Philip Vallone
H, I want to cast a NSNumber to int. When I execute the below code, my result should be 1, not 68213232. What am I doing wrong? Code: NSNumber *setCurrentCount = [NSNumber numberWithInt: 1]; NSLog(@"Test NSNumber cast to int: %i", setCurrentCount); Output: Test NSNumber cast to int: 68213232

Re: Cast NSNumber to int

2009-11-28 Thread Andrew Farmer
On 28 Nov 2009, at 03:20, Philip Vallone wrote: > I want to cast a NSNumber to int. When I execute the below code, my result > should be 1, not 68213232. What am I doing wrong? You are trying to cast a pointer to an integer and expecting meaningful results. Don't. If you want to get the numeric

Re: Cast NSNumber to int

2009-11-28 Thread Philip Vallone
Thanks for the quick response. Works like a charm! On Nov 28, 2009, at 6:26 AM, Andrew Farmer wrote: > On 28 Nov 2009, at 03:20, Philip Vallone wrote: >> I want to cast a NSNumber to int. When I execute the below code, my result >> should be 1, not 68213232. What am I doing wrong? > > You are

Re: Apache Module

2009-11-28 Thread Sherm Pendley
On Fri, Nov 27, 2009 at 6:45 PM, Mr. Gecko wrote: > Hello, I'm working to write an Apache Module that allows you to make websites > in Objective-C Been there, done that. :-) Have a look at the list archives: sherm-- -- Cocoa

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

2009-11-28 Thread Gwynne Raskind
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 >} @catch (id e) { >// Othe

Re: Apache Module

2009-11-28 Thread Sherm Pendley
On Sat, Nov 28, 2009 at 7:54 AM, Sherm Pendley wrote: > On Fri, Nov 27, 2009 at 6:45 PM, Mr. Gecko wrote: >> Hello, I'm working to write an Apache Module that allows you to make >> websites in Objective-C > > Been there, done that. :-) > > Have a look at the list archives: >

Re: Global Object

2009-11-28 Thread Tom Jones
Thanks, I found this (http://codeendeavor.com/archives/535) nice wrapper for ASL and I wanted to see how I could incorporate it in to my app. Since this is a foundation tool I wanted to init it in my "myTestApp.m" main function, and be able to call "[log info:@"Log Stuff"];" in any of my classes

Re: Apache Module

2009-11-28 Thread Mr. Gecko
Ok, I know your idea of a CGI Proxy like PHP CGI and I might try and see how that works. If it works great, I may use it instead of a module, but for now I finish making my first cocoa module at http://mrgeckosmedia.com/mod_example.zip Thanks for the help, Mr. Gecko On Nov 28, 2009, at 9:32 AM,

Confused about Memory Management with Collections

2009-11-28 Thread Mazen M. Abdel-Rahman
Hi All, I am trying to find out how memory is retained/released when using different Cocoa collection classes. Is there a good resource on this anyone can connect me to? Here is some detailed questions about what I am trying to find out: If I create a dictionary in the following manner (where

Re: Confused about Memory Management with Collections

2009-11-28 Thread Dave DeLong
Hi Mazen, Yes, objects that are added to collections objects (array, set, dictionary) are automatically retained by that collection and not released until removed from the collection or the collection is deallocated. If you don't need them "anywhere else outside the dictionary", then you shoul

When to use exception handling?

2009-11-28 Thread Helen Cooper
I'm trying to understand when to use exception handling when developing Cocoa applications. In regard to this, two points stand out to me in Apple's documentation: "exceptions are resource-intensive in Objective-C" "Conditions giving rise to exceptions are due to programming errors; you shoul

Re: When to use exception handling?

2009-11-28 Thread Jens Alfke
On Nov 28, 2009, at 1:29 PM, Helen Cooper wrote: > "exceptions are resource-intensive in Objective-C" In the 32-bit runtime, @try is fairly expensive (it has to save all the CPU registers to the stack), so you pay for exception handling even if no exceptions are thrown. In the 64-bit runtime,

Is there a key path for this?

2009-11-28 Thread David Hirsch
I want to know if I can do this with bindings or not. I've read a good deal, and tried a few things without success. My document class has an array of Instructors, with a controller. Each instructor has a timeConstraint, which in turn has an array of NSNumbers. I have an NSTableView boun

Re: dynamic NSPointArray allocation

2009-11-28 Thread Quincey Morris
On Nov 27, 2009, at 14:58, Shane wrote: > I think I'm understanding this in part ... > > // *.h > NSMutableData *pointData; > NSPointArray *points; > > // *.m > pointData = [[NSMutableData alloc] init]; > > ... > > NSPoint point = NSMakePoint([iters floatValue], [

Re: dynamic NSPointArray allocation

2009-11-28 Thread Henry McGilton (Boulevardier)
On Nov 28, 2009, at 2:50 PM, Quincey Morris wrote: > On Nov 27, 2009, at 14:58, Shane wrote: > >> I think I'm understanding this in part ... >> >> // *.h >> NSMutableData *pointData; >> NSPointArray *points; >> >> // *.m >> pointData = [[NSMutableData alloc] init]; >> >> .

Re: Is there a key path for this?

2009-11-28 Thread Quincey Morris
On Nov 28, 2009, at 14:45, David Hirsch wrote: > My document class has an array of Instructors, with a controller. Each > instructor has a timeConstraint, which in turn has an array of NSNumbers. I > have an NSTableView bound to the Instructor array, and I would like to show > the mondayCosts

Re: dynamic NSPointArray allocation

2009-11-28 Thread Andrew Farmer
On 28 Nov 2009, at 15:12, Henry McGilton (Boulevardier) wrote: > Another possible approach is simply use a NSMutableArray full of NSValue > objects that contain > the NSPoint structures . . . I don't believe that'll work - storing everything in NSValue objects will end up scattering the actual N

SystemConfiguration.framework

2009-11-28 Thread William Squires
Okay, here's the deal: Norton Firewall notifies me that configd is attempting to access the internet, so I block it. I then pull up Terminal.app and "man configd". That in turn, leads me to "SystemConfiguration.framework SCDynamicStore.h" So, I make a new XCode CoreFoundation Tool projec

Re: SystemConfiguration.framework

2009-11-28 Thread Bill Bumgarner
On Nov 28, 2009, at 5:02 PM, William Squires wrote: > SCDynamicStoreRef > SCDynamicStoreCreate ( > CFAllocatorRef allocator, > CFStringRef name, > SCDynamicStoreCallBack callout, > SCDynamicStoreContext, *context > ); > > Here's where my confusion begins. Did you read the documentation for

Re: SystemConfiguration.framework

2009-11-28 Thread Jens Alfke
On Nov 28, 2009, at 5:02 PM, William Squires wrote: > So, I make a new XCode CoreFoundation Tool project, and import the > SystemConfiguration.framework. I then look under "External Frameworks and > Libraries" (where I dragged the system configuration framework), and look in > the headers. >

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

2009-11-28 Thread Michael Ash
On Fri, Nov 27, 2009 at 2:40 PM, Mark Allan wrote: > > On 27 Nov 2009, at 1:10 am, Dave Keck wrote: >>> >>> Exception Type:  EXC_BAD_ACCESS (SIGBUS) >> >> After a cursory reading of your code it looks like you're dealing with >> a threading issue involving myItemList or imminentList. Your comment