Re: Packages vs bundles vs folders etc

2009-05-10 Thread Peter Ammon
On May 10, 2009, at 10:43 PM, Chris Idou wrote: >> Would it be fair to say that if a path is a directory, and if the kMDItemContentType != public.folder then NSWorkspace.isFilePackageAtPath would >return YES? > >No. A non-package directory may not even conform to public.folder. For ex

Re: Packages vs bundles vs folders etc

2009-05-10 Thread Chris Idou
>> Would it be fair to say that if a path is a directory, and if the >> kMDItemContentType != public.folder then NSWorkspace.isFilePackageAtPath >> would >return YES? > >No. A non-package directory may not even conform to public.folder. For >example, volume mount points have the type ID pu

[iPhone] UITableViewController headache

2009-05-10 Thread James Lin
Hi all, This is strange, i don't know what to make of it. I have a view with a TableView in it. If i use UITableViewController class, which is supposed to be the correct class to use, the tableview (which has 1 UILabel and 1 UITextField combined cells) is only correctly rendered up to cell

Re: Listing running process

2009-05-10 Thread Jerry Krinock
On 2009 May 09, at 11:29, Arivan S. Bastos wrote: How do I list the running processes of the operating system? And how get info about that processes? Start by reading in your Xcode API documentation for NSWorkspace, and if that doesn't dig deep enough for you, check out functions in the

Re: Converting NSString to C++ std::string

2009-05-10 Thread Stephen J. Butler
On Sat, May 9, 2009 at 7:45 AM, Andrew Wood wrote: > The controllers header file is as follows. As you can see I decalre dbhost > as a std::string, but dont initialise it. That is a false statement. > The initalisation (which crashes) is done in the doLogin action method. Nope. What happens is

Re: Garbage collector related crash

2009-05-10 Thread Bill Bumgarner
On May 10, 2009, at 7:22 PM, Chris Idou wrote: Err, why isn't that a workaround? If retaining it but not freeing it is a workaround, why wouldn't retaining it and freeing it after I am done with it work? Because the cache will end up with with a dangling pointer that you can't do anything

Re: Disabling check box cells

2009-05-10 Thread John Baldwin
Thanks. "Conditionally sets enabled" was the issue. The link to the video no longer seems to work, however. John On Friday May 8 4:33 AM, at 4:33 AM, Kyle Sluder wrote: On Wed, May 6, 2009 at 1:37 AM, John Baldwin > wrote: I'm fairly new to Cocoa, and I have a table with columns bound to an

Re: Best approach to make session based applications

2009-05-10 Thread Greg Guerin
Marcus wrote: This is something I've been thinking about for a while without making much progress. Let's say that you have an application where you would have one or many "documents" but where the documents itself are not tied to a specific file. Examples of such applications could be ter

Re: Packages vs bundles vs folders etc

2009-05-10 Thread Peter Ammon
On May 10, 2009, at 6:46 PM, Chris Idou wrote: Would it be fair to say that if a path is a directory, and if the kMDItemContentType != public.folder then NSWorkspace.isFilePackageAtPath would return YES? No. A non-package directory may not even conform to public.folder. For example,

Re: Garbage collector related crash

2009-05-10 Thread Chris Idou
Err, why isn't that a workaround? If retaining it but not freeing it is a workaround, why wouldn't retaining it and freeing it after I am done with it work? From: Bill Bumgarner To: Chris Idou Cc: cocoa-dev@lists.apple.com Sent: Monday, 11 May, 2009 11:59:

Re: Custom Sheets

2009-05-10 Thread Jerry Krinock
On 2009 May 09, at 05:04, Marcelo Cicconet wrote: But the sheet doesn't appear properly (attached to the window) and the method orderOut: doesn't work. Ah, I'm so glad you asked this, since I spent a couple hours tracking this down myself last week and after finding no advice in the archive

Re: Xcode 3.1.3 console output broken

2009-05-10 Thread sk
Hello Dave, Thanks, I've kind of put two and two together - the lack of responses anywhere, plus the fact you just mentioned the NDA. I'll search elsewhere, thank you. - Ben Dave Camp wrote: Since Xcode 3.1.3 is pre-release software, it's under NDA and you can't discuss it here. Try

Re: Xcode 3.1.3 console output broken

2009-05-10 Thread Dave Camp
Since Xcode 3.1.3 is pre-release software, it's under NDA and you can't discuss it here. Try Dave On May 9, 2009, at 7:19 PM, sk wrote: Hello, Today has been a headache - first my upgrade to xcode 3.1.3 trashed all my certs/provisions. After two attempts, I g

Re: Xcode 3.1.3 console output broken

2009-05-10 Thread Kyle Sluder
On Sat, May 9, 2009 at 10:19 PM, sk wrote: > Today has been a headache - first my upgrade to xcode 3.1.3 trashed all my > certs/provisions. After two attempts, I got them fixed. No Xcode 3.1.3 for us without seed access. --Kyle Sluder ___ Cocoa-dev ma

Re: Xcode 3.1.3 console output broken

2009-05-10 Thread sk
Hello, I've filed a bug report and I fixed this by creating a new empty project and importing all my work. It is still broken in the old project. Someone suggested that the console slider could have been moved to the extreme top,right,left or bottom. But I triple checked that was not the iss

Re: Garbage collector related crash

2009-05-10 Thread Bill Bumgarner
On May 10, 2009, at 6:35 PM, Chris Idou wrote: Is it fixed in a later version of Leopard, or in Snow Leopard? Snow Leopard. And it is a workaround to release it in the finalizer of the object that retains it and uses it? No. b.bum ___ Cocoa-de

Packages vs bundles vs folders etc

2009-05-10 Thread Chris Idou
Would it be fair to say that if a path is a directory, and if the kMDItemContentType != public.folder then NSWorkspace.isFilePackageAtPath would return YES? And conversely if a path is not a directory or the kMDItemContentType == public.folder, then NSWorkspace.isFilePackageAtPath would retur

Re: NSTask temrinationStatus always == 1?

2009-05-10 Thread Jim Correia
On Sun, May 10, 2009 at 2:18 PM, marc hoffman wrote: > i have an odd issue with NSTask. for some reason, no matter what result code > my executable returns (im running xcodebuild, if that matters), NSTask's > terminationStatus always reports back as 1. if instead i use system() to run > the exact

Re: Hex to NSString or NSData

2009-05-10 Thread Andreas Grosam
On May 9, 2009, at 11:20 PM, Marcel Weiher wrote: Hi Andreas, that's an interesting way to do the conversion. On May 9, 2009, at 10:50 , Andreas Grosam wrote: int hexDigitToInt(char d) { int result; switch (d) { case '0': result = 0; break; case '1': result = 1; break; [snip

Best approach to make session based applications

2009-05-10 Thread Marcus
Hi. This is something I've been thinking about for a while without making much progress. Let's say that you have an application where you would have one or many "documents" but where the documents itself are not tied to a specific file. Examples of such applications could be terminal emul

Xcode 3.1.3 console output broken

2009-05-10 Thread sk
Hello, Today has been a headache - first my upgrade to xcode 3.1.3 trashed all my certs/provisions. After two attempts, I got them fixed. Now, I'm dealing with the issue in the subject, no console output. Absolutlely nothing is getting printed to the console - No startup info, not when I "pri

NSToolbarItem with custom view in Interface Builder 3 (Leopard)

2009-05-10 Thread Gunnar Proppe
I followed the steps described here to set up a toolbar item with a custom view in Interface Builder: http://developer.apple.com/documentation/Cocoa/Conceptual/Toolbars/Articles/ToolbarInIB.html Unfortunately my custom view's drawRect is never called. I verified that it does get initialized. Th

Listing running process

2009-05-10 Thread Arivan S. Bastos
Hi, How do I list the running processes of the operating system? And how get info about that processes? I need to do this, because I have a need to identify whether any third-party applications are running, to avoid problems with my program. I need to identify the running process, determine the e

Re: Converting NSString to C++ std::string

2009-05-10 Thread Andrew Wood
The controllers header file is as follows. As you can see I decalre dbhost as a std::string, but dont initialise it. The initalisation (which crashes) is done in the doLogin action method. #import #include @interface CoreController : NSObject { //App Windows IBOutlet NSWin

Custom Sheets

2009-05-10 Thread Marcelo Cicconet
Hi. I've tried to use custom sheets following this tutorial: http://developer.apple.com/documentation/Cocoa/Conceptual/Sheets/Tasks/UsingCustomSheets.html#//apple_ref/doc/uid/20001290 But the sheet doesn't appear properly (attached to the window) and the method orderOut: doesn't work. Any ideas abo

Re: Make an attributed string all uppercase without losing attributes?

2009-05-10 Thread Jim Correia
On Fri, May 8, 2009 at 10:56 PM, Graham Cox wrote: > I have an attributed string. I want to preserve the attributes within the > string but set all the actual characters to uppercase, lowercase, etc. > > According to the docs for NSMutableAttributedString, the -mutableString > method returns a mut

Help debugging bindings issues

2009-05-10 Thread Alex Smith
Hi, I'm very new to Cocoa development, but I am stuck on what I'm sure will end up being a very stupid mistake. The book I am working through (Cocoa Programming for Mac OS X by Aaron Hillegass), has me creating a simple app with table and two columns. However, the bindings to each of the p

Re: LaunchAgent Creation

2009-05-10 Thread Greg Guerin
Jerry Krinock wrote: You've almost got it. I believe this might come close to working, assuming for example that you want -Rf options on cp: ... Program /bin/cp ProgramArguments -R f If you want -Rf options, I'm pretty sure it should be: -Rf Otherwise it

Re: Garbage collector related crash

2009-05-10 Thread Chris Idou
Is it fixed in a later version of Leopard, or in Snow Leopard? And it is a workaround to release it in the finalizer of the object that retains it and uses it? From: Bill Bumgarner To: Chris Idou Cc: cocoa-dev@lists.apple.com Sent: Monday, 11 May, 2009 2:4

Re: Attr Str drawing vs Layout Manager drawing

2009-05-10 Thread Seth Willits
On May 10, 2009, at 5:48 PM, Kyle Sluder wrote: On Sun, May 10, 2009 at 8:30 PM, Seth Willits wrote: "You can release the text container because the layout manager retains it, and you can release the layout manager because the text storage object retains it." It's fine as long as you do

Re: Attr Str drawing vs Layout Manager drawing

2009-05-10 Thread Kyle Sluder
On Sun, May 10, 2009 at 8:30 PM, Seth Willits wrote: > "You can release the text container because the layout manager retains it, > and you can release the layout manager because the text storage object > retains it." It's fine as long as you don't continue to use the objects directly. The sample

Re: LaunchAgent Creation

2009-05-10 Thread Jerry Krinock
You've almost got it. I believe this might come close to working, assuming for example that you want -Rf options on cp: ... Program /bin/cp ProgramArguments -R f /source/path /destin/path ... By the way, if cp works for you, that's fine but there a

Re: Attr Str drawing vs Layout Manager drawing

2009-05-10 Thread Seth Willits
On May 10, 2009, at 2:35 PM, Peter Ammon wrote: You may be seeing differences in the typesetter behavior. See the discussion of typesetter behaviors at http://developer.apple.com/documentation/Cocoa/Conceptual/TextLayout/Concepts/Typesetters.html and the "String Drawing and Typesetter Behavi

Re: Hex to NSString or NSData

2009-05-10 Thread Alastair Houghton
On 10 May 2009, at 18:45, Andreas Grosam wrote: On May 10, 2009, at 1:05 AM, Gwynne Raskind wrote: The smallest (and likely fastest) would probably be the lookup table version: The smallest in terms of code, and it is probably the fasted method. But it is also the most error prone ;) Just

Re: Attr Str drawing vs Layout Manager drawing

2009-05-10 Thread Kyle Sluder
On Sun, May 10, 2009 at 5:35 PM, Peter Ammon wrote: > the "String Drawing and Typesetter Behavior" topic at > http://developer.apple.com/documentation/Cocoa/Conceptual/TextLayout/Tasks/DrawingStrings.html Just filed a document feedback on this one. It recommends releasing objects and continuing

LaunchAgent Creation

2009-05-10 Thread Pierce Freeman
Hi everyone: I am attempting to create a LaunchAgent that will copy a file to a specific location at login and when the file changes. My code is below, however I just can't find out how to make it copy the file without using AppleScript. I was thinking a cp command passing it the locations, but I

Re: NSTask temrinationStatus always == 1?

2009-05-10 Thread Michael Ash
On Sun, May 10, 2009 at 2:18 PM, marc hoffman wrote: > Hi, > > i have an odd issue with NSTask. for some reason, no matter what result code > my executable returns (im running xcodebuild, if that matters), NSTask's > terminationStatus always reports back as 1. if instead i use system() to run > th

Re: Attr Str drawing vs Layout Manager drawing

2009-05-10 Thread Peter Ammon
On May 10, 2009, at 2:24 PM, Seth Willits wrote: If I create a text view, type in some text with different styles multiple lines etc, and grab the attributed string object, when I draw that attributed string using drawInRect: with the same bounds as the text view, there are small differe

Attr Str drawing vs Layout Manager drawing

2009-05-10 Thread Seth Willits
If I create a text view, type in some text with different styles multiple lines etc, and grab the attributed string object, when I draw that attributed string using drawInRect: with the same bounds as the text view, there are small differences between the two. The line height seems to be

Re: detect option key on startup

2009-05-10 Thread John Joyce
Depending on why you want to do this, you may want/need to try different approaches with mini-test apps to see what your results are. If you test with iPhoto for example, it does load the main menu nib, but loads a different nib than the usual main window for choosing or creating an iPhoto li

Re: NSTask temrinationStatus always == 1?

2009-05-10 Thread Jim Correia
On Sun, May 10, 2009 at 2:18 PM, marc hoffman wrote: > i have an odd issue with NSTask. for some reason, no matter what result code > my executable returns (im running xcodebuild, if that matters), NSTask's > terminationStatus always reports back as 1. if instead i use system() to run > the exact

NSTask temrinationStatus always == 1?

2009-05-10 Thread marc hoffman
Hi, i have an odd issue with NSTask. for some reason, no matter what result code my executable returns (im running xcodebuild, if that matters), NSTask's terminationStatus always reports back as 1. if instead i use system() to run the exact same command, i get bak proper error codes (0 fo

Re: Hex to NSString or NSData

2009-05-10 Thread Andreas Grosam
On May 10, 2009, at 1:05 AM, Gwynne Raskind wrote: The smallest (and likely fastest) would probably be the lookup table version: The smallest in terms of code, and it is probably the fasted method. But it is also the most error prone ;) And the switch-case version compiles to three pages o

Re: Hex to NSString or NSData

2009-05-10 Thread Greg Guerin
Gwynne Raskind wrote: Can you suggest a means to account for the overhead? The classic way is to measure the same loop calling a trivial function. Report this as t(overhead) and subtract. A trivial function has the same args and return type as the code- under-test but does nothing. For

Re: Not sleeping - Why?

2009-05-10 Thread Trygve Inda
> > On May 8, 2009, at 12:48 PM, Trygve Inda wrote: > >> My app is a background app that sends and receives distributed >> notifications, reads from a few large mmap'd files and crates a new >> file >> every few minutes (and deletes the old one). >> >> When it is running, the display sleeps, but

Re: Garbage collector related crash

2009-05-10 Thread Bill Bumgarner
On May 10, 2009, at 3:47 AM, Chris Idou wrote: When you are saying "it is broken" on Leopard, what exactly do you say you know is broken? GC in general, or the __strong thing, or ? There is a bug internal the MD* API that causes this particular crash because it creates dangling weak refe

Re: Subject: detect option key on startup

2009-05-10 Thread Kirk Kerekes
I often add the following to the app delegate's applicationDidFinishLaunching: method [self performSelector: @selector(applicationDidBeginRunLoop:) withObject: self afterDelay: 0.0]; applicationDidBeginRunLoop: (which you must define) will execute when the first runloop cycle executes.

Re: Hex to NSString or NSData

2009-05-10 Thread Michael Ash
On Sun, May 10, 2009 at 4:50 AM, Uli Kusterer wrote: > On 10.05.2009, at 05:57, Mr. Gecko wrote: >> >> int char2hex(unichar c) { >>        switch (c) { >>                case '0' ... '9': return c - '0'; >>                case 'a' ... 'f': return c - 'a' + 10; >>                case 'A' ... 'F': r

Re: Garbage collector related crash

2009-05-10 Thread Chris Idou
When you are saying "it is broken" on Leopard, what exactly do you say you know is broken? GC in general, or the __strong thing, or ? From: Bill Bumgarner To: Chris Idou Cc: cocoa-dev@lists.apple.com Sent: Saturday, 9 May, 2009 3:58:11 AM Subject: Re: G

Re: Hex to NSString or NSData

2009-05-10 Thread Uli Kusterer
On 10.05.2009, at 05:57, Mr. Gecko wrote: int char2hex(unichar c) { switch (c) { case '0' ... '9': return c - '0'; case 'a' ... 'f': return c - 'a' + 10; case 'A' ... 'F': return c - 'A' + 10; default: return -1; } }