how to create a faceless background application

2008-10-14 Thread han
My application uses a faceless background application to perform some calculations. This background application is launched and terminated by my foreground application.But I don't know how to create a faceless background application? thanks. ___

Re: how to create a faceless background application

2008-10-14 Thread Jens Beuckenhauer
Hello, My application uses a faceless background application to perform some calculations. This background application is launched and terminated by my foreground application.But I don't know how to create a faceless background application? 1.) start Xcode 2.) choose New Project 3.)

Re: how to create a faceless background application

2008-10-14 Thread Joseph Crawford
han, by any chance would you be talking about NSThread? You want to break a process off into another thread to complete your calculation then notify your application when it is completed. This will not hold up the UI while doing the calculation. I am not sure how to implement it as I

Re: NSCollectionView - getting notified of selection change?

2008-10-14 Thread Markus Spoettl
On Oct 13, 2008, at 8:10 PM, Graham Cox wrote: OK, it's a bug. Filed. Bah... I'm a little late to this and I'm not really sure what the problem is. In my app I'm observing the -selectedObjects property of the NSArrayController that supplies the data to the NSCollectionView. Works

Re: intercepting NSBrowser multiple selection extension with shift down/up arrow

2008-10-14 Thread Andy Lee
On Oct 14, 2008, at 12:45 AM, Martin Redington wrote: On Tue, Oct 14, 2008 at 5:25 AM, Andy Lee [EMAIL PROTECTED] wrote: How about if you leave the matrix class alone and do [myBrowser setSendsActionOnArrowKeys:YES]? Then give the browser a target and action, and in the action method do

[Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning

2008-10-14 Thread Oleg Krupnov
In my project I have two different, totally unrelated classes. @interface ClassA : NSObject{} -(id)initWithContext:(ContextA*)context; @end @interface ClassB : NSObject{} -(id)initWithContext:(ContextB*)context; @end The problem is that when I call ContextA* context = ...; [[ClassA alloc]

Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning

2008-10-14 Thread Chris Suter
On Tue, Oct 14, 2008 at 9:13 PM, Graham Cox [EMAIL PROTECTED] wrote: Isn't the problem here with the init method, rather than alloc? It's a problem with both. NSString et. al. return id because they are class clusters (and because it's the established convention), I believe the fact that

Re: intercepting NSBrowser multiple selection extension with shift down/up arrow

2008-10-14 Thread Martin Redington
On Tue, Oct 14, 2008 at 8:12 AM, Andy Lee [EMAIL PROTECTED] wrote: On Oct 14, 2008, at 12:45 AM, Martin Redington wrote: On Tue, Oct 14, 2008 at 5:25 AM, Andy Lee [EMAIL PROTECTED] wrote: How about if you leave the matrix class alone and do [myBrowser setSendsActionOnArrowKeys:YES]? Then

Re: intercepting NSBrowser multiple selection extension with shift down/up arrow

2008-10-14 Thread Andy Lee
On Oct 14, 2008, at 8:11 AM, Martin Redington wrote: On Tue, Oct 14, 2008 at 8:12 AM, Andy Lee [EMAIL PROTECTED] wrote: If it helps with the ick factor, I would say that it's much less hacky to take advantage of one method's documented purpose -- do something when the selection changes, even

Re: NSCollectionView - getting notified of selection change?

2008-10-14 Thread Graham Cox
On 14 Oct 2008, at 6:08 pm, Markus Spoettl wrote: Since you have to have an array controller to get the collection view its data there is no overhead in this method. Well, I don't have an array controller. I just set the view's content using -setContent:, as documented. Maybe the bug

[CODE] JPDurationToDecimalNumberFormatter

2008-10-14 Thread Jamie Phelps
Hi, all. I have received so much help from this list that I wanted to share a small something back. It is a subclass of NSNumberFormatter to format time duration. It works for me but I'm sure it could be improved as well. You can download it from my iDisk public folder

Re: UI elements in custom view mess up drawing

2008-10-14 Thread Benjamin Stiglitz
When I turn off the progress indicator however, or when I update the string value of the text field, the drawing from the drawRect method above is drawn offset from its origin, instead drawing at the origin of either of the subviews, resulting in spurious lines being drawn where there

Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning

2008-10-14 Thread Oleg Krupnov
You are right, casting from alloc worked, thank you. Is it the recommended practice to always cast after alloc? I still have a question in this regard. If the alloc returns id, then, from the compiler's perspective, there can be two solutions: 1) assume that the id type can have each and any

Re: replacing carbon menu with cocoa

2008-10-14 Thread Esteban Lorenzano
Hi, I loaded from Nib, as you suggest, and something strange happens - strange, but near what I need- If I load a Nib, the new main menu overlaps the old one (and two menus coexist)... but new Main Menu redraws apple menu too, and disappear if I reload the Nib. Finally, if I first clean

Re: NSBrowser, NSTreeController and Core Data

2008-10-14 Thread Mark .
On Oct 13, 2008, at 15:44, Quincey Morris wrote: Your relationship is from categories to subcategories (and inversely from categories to parent categories). So calling the relationship id makes no sense. IAC, to-many relationship names make more sense if they're plural (categories instead

EXC_BAD_ACCESS with NSAutoReleasePool, NSThread and NSThreadWillExitNotification

2008-10-14 Thread John Zorko
Hello, all ... I'm experiencing a crash after a thread exits. Program received signal: “EXC_BAD_ACCESS”. (gdb) bt #0 0x300c8c18 in objc_msgSend () #1 0x3067073a in NSPopAutoreleasePool () #2 0x306770ea in __NSFinalizeThreadData () #3 0x31446f6e in _pthread_tsd_cleanup () #4 0x31449ae4 in

Re: EXC_BAD_ACCESS with NSAutoReleasePool, NSThread and NSThreadWillExitNotification

2008-10-14 Thread Jonathan del Strother
On Tue, Oct 14, 2008 at 3:38 PM, John Zorko [EMAIL PROTECTED] wrote: Hello, all ... I'm experiencing a crash after a thread exits. Program received signal: EXC_BAD_ACCESS. (gdb) bt #0 0x300c8c18 in objc_msgSend () #1 0x3067073a in NSPopAutoreleasePool () #2 0x306770ea in

Re: Providing replicable views in IB

2008-10-14 Thread Michael Ash
On Tue, Oct 14, 2008 at 11:38 AM, Matteo Manferdini [EMAIL PROTECTED] wrote: Hi all, I was trying to find a way to design a replicable view in IB. The behaviour I'm trying to replicate is the one of NSCollectionView: it gets a custom view designed in IB as the prototype view and then

listening for changes to active application

2008-10-14 Thread Robert Nikander
Hi, How can I be notified when the foreground application changes? I found activeApplication in NSWorkspace. Is there a way to observe changes to that property? I tried the following, which doesn't seem to work... [[NSWorkspace sharedWorkspace] addObserver:obs

Not so long filenames

2008-10-14 Thread Gerriet M. Denkmann
HFS+ and Finder can use filenames which use in Utf-16 up to 255 shorts. But in the program below there seems to exist some other limit (at least on 10.4.11 Tiger). Where is this documented? Or what am I doing wong? #import Cocoa/Cocoa.h int main (int argc, const char * argv[]) {

Re: intercepting NSBrowser multiple selection extension with shift down/up arrow

2008-10-14 Thread Martin Redington
On Tue, Oct 14, 2008 at 2:04 PM, Andy Lee [EMAIL PROTECTED] wrote: On Oct 14, 2008, at 8:11 AM, Martin Redington wrote: On Tue, Oct 14, 2008 at 8:12 AM, Andy Lee [EMAIL PROTECTED] wrote: If it helps with the ick factor, I would say that it's much less hacky to take advantage of one method's

Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning

2008-10-14 Thread Quincey Morris
On Oct 14, 2008, at 02:17, Oleg Krupnov wrote: If the alloc returns id, then, from the compiler's perspective, there can be two solutions: 1) assume that the id type can have each and any method and let it be resolved at run time without any compiler warning or 2) assume that the id does not

Re: Not so long filenames

2008-10-14 Thread Jason Coco
On Oct 14, 2008, at 11:28 , Gerriet M. Denkmann wrote: HFS+ and Finder can use filenames which use in Utf-16 up to 255 shorts. But in the program below there seems to exist some other limit (at least on 10.4.11 Tiger). Where is this documented? Or what am I doing wong? ... Filewrapper

Re: Providing replicable views in IB

2008-10-14 Thread Ashley Clark
You can implement copying of a view by archiving and immediately unarchiving the root view. Something like this (written on the phone, don't expect this to parse correctly immediately): -(id)copyWithZone:(NSZone *)zone { return [NSKeyedUnarchiver unarchiveObjectWithData:

Re: Finding clicked row in NSOutlineView

2008-10-14 Thread James Walker
Michael Ash wrote: On Mon, Oct 13, 2008 at 9:23 PM, James Walker [EMAIL PROTECTED] wrote: I need to be notified when a row of an NSOutlineView was clicked, and find out which row. See these methods: -setAction: -setTarget: -clickedRow Thanks, don't know how I missed that. -- James W.

Re: replacing carbon menu with cocoa

2008-10-14 Thread Peter Ammon
I honestly don't know - replacing a Carbon main menu with a Cocoa main menu at runtime isn't a configuration I've ever tested. If what you tried works and you're happy with the result, I guess go with it. -Peter On Oct 14, 2008, at 7:09 AM, Esteban Lorenzano wrote: Hi, I loaded from Nib,

Re: +(NSSet *)keyPathsForValuesAffectingValueForKey:

2008-10-14 Thread Clark Cox
On Mon, Oct 13, 2008 at 9:43 PM, Chris Idou [EMAIL PROTECTED] wrote: Does anyone know if you can use this mechanism for dotted values, or does it have to be a value local to the object? Yes, you can use dotted values (that is why it is keyPathsForValues..., not keysForValues...) For

Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning

2008-10-14 Thread Chris Suter
On Tue, Oct 14, 2008 at 8:17 PM, Oleg Krupnov [EMAIL PROTECTED] wrote: You are right, casting from alloc worked, thank you. Is it the recommended practice to always cast after alloc? I still have a question in this regard. If the alloc returns id, then, from the compiler's perspective,

Re: EXC_BAD_ACCESS with NSAutoReleasePool, NSThread and NSThreadWillExitNotification

2008-10-14 Thread John Zorko
Jonathan et al, Yup -- that was exactly it -- had nothing to do with the thread, even ... I had instantiated something and made it autorelease, but then proceeded to release it myself anyway like a doof. On Oct 14, 2008, at 7:47 AM, Jonathan del Strother wrote: On Tue, Oct 14, 2008 at

Providing replicable views in IB

2008-10-14 Thread Matteo Manferdini
Hi all, I was trying to find a way to design a replicable view in IB. The behaviour I'm trying to replicate is the one of NSCollectionView: it gets a custom view designed in IB as the prototype view and then replicates it to display its contents. Is there an easy way to do this? Since NSView does

UI elements in custom view mess up drawing

2008-10-14 Thread Antonio Nunes
Hi, I have a custom view that draws half a frame and a gradient: - (void)drawRect:(NSRect)rect { // This results in darker separator line at left side. [[NSColor colorWithCalibratedWhite:0.18 alpha:1.0] set]; NSRectFill(NSMakeRect(NSMinX(rect), NSMinY(rect), 1,

Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning

2008-10-14 Thread Roland King
Oleg Krupnov wrote: You are right, casting from alloc worked, thank you. Is it the recommended practice to always cast after alloc? Not really - the recommended practice is to have method names which have unique parameter types. Remember that Objective-C's notion of a selector is

Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning

2008-10-14 Thread Graham Cox
On 14 Oct 2008, at 8:17 pm, Oleg Krupnov wrote: You are right, casting from alloc worked, thank you. Is it the recommended practice to always cast after alloc? No, I never do it. I never see code that routinely does it either. I still have a question in this regard. If the alloc returns

Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning

2008-10-14 Thread Graham Cox
On 14 Oct 2008, at 8:58 pm, Chris Suter wrote: The proper way to solve this, in my opinion, is to allow a way of specifying that the return type varies depending on the class it's implemented on i.e. define the alloc method in such a way so that the compiler knows that -[class alloc] returns

Re: listening for changes to active application

2008-10-14 Thread Jason Coco
On Oct 14, 2008, at 11:58 , Robert Nikander wrote: Hi, How can I be notified when the foreground application changes? I found activeApplication in NSWorkspace. Is there a way to observe changes to that property? I tried the following, which doesn't seem to work... [[NSWorkspace

Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning

2008-10-14 Thread Chris Suter
On Tue, Oct 14, 2008 at 7:43 PM, Oleg Krupnov [EMAIL PROTECTED] wrote: In my project I have two different, totally unrelated classes. @interface ClassA : NSObject{} -(id)initWithContext:(ContextA*)context; @end @interface ClassB : NSObject{} -(id)initWithContext:(ContextB*)context;

Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning

2008-10-14 Thread Graham Cox
On 14 Oct 2008, at 10:11 pm, Chris Suter wrote: I believe the fact that they are class clusters is irrelevant; it's an implementation detail. The objects returned still conform to the interfaces defined by NSString and NSMutableString. They return id, rather than NSString say, because

Re: Not so long filenames

2008-10-14 Thread Gerriet M. Denkmann
On 14 Oct 2008, at 18:07, Jason Coco wrote: On Oct 14, 2008, at 11:28 , Gerriet M. Denkmann wrote: HFS+ and Finder can use filenames which use in Utf-16 up to 255 shorts. But in the program below there seems to exist some other limit (at least on 10.4.11 Tiger). Where is this

Re: UI elements in custom view mess up drawing

2008-10-14 Thread Graham Cox
On 15 Oct 2008, at 12:38 am, Antonio Nunes wrote: As you can see from the image it looks like the view first draws itself correctly, then gets drawn for each of the other subviews, with its origin offset to match the origin of the subview in question. I don't understand why this happens.

Re: UI elements in custom view mess up drawing

2008-10-14 Thread Antonio Nunes
On 14 Oct 2008, at 14:43, Benjamin Stiglitz wrote: The rect passed to -[NSView drawRect:] is the dirty rect of the view, not the bounds of the view. The changing subviews are dirtying your view and then you're drawing as if that changed area was your complete frame. Try replacing your use

Re: Cocoa-dev Digest, Vol 5, Issue 1774

2008-10-14 Thread David Murphy
hi folks, I'm looking to build a view, similar to the upper sequential thumbnail view in iPhoto's Edit mode window. Before I go and build my own version, does anyone know if this is already available in an existing framework or library (from Apple or elsewhere)? cheers rgds Dave

Sharing a Bindings Controller between nibs

2008-10-14 Thread Citizen
Hi, I'm just getting to grips with bindings. I have a master-detail interface, where the Detail interface is in a separate nib from the main Master interface (so that different Detail interfaces can be swapped in). The main Master interface nib contains an NSTreeController which is used

VCards Address Book -- Preferred Telephone Number

2008-10-14 Thread Thaddeus Cooper
When one generates a vcard from an Address Book entry how does Address Book decide what the preferred telephone number is. Thanks very much. Thaddeus O. Cooper ([EMAIL PROTECTED]) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do

Re: VCards Address Book -- Preferred Telephone Number

2008-10-14 Thread Nick Zitzmann
On Oct 14, 2008, at 4:53 PM, Thaddeus Cooper wrote: When one generates a vcard from an Address Book entry how does Address Book decide what the preferred telephone number is. The preferred value is the value that is designated as primary identifier in the ABMultiValue. Nick Zitzmann

Re: Animating view transitions with Core Animation (problems with BasicCocoaAnimations sample)

2008-10-14 Thread Thomas Engelmeier
Am 14.10.2008 um 00:51 schrieb Jim Correia: Problem #3: My current hack is to begin the implicit animations in a group, and use a perform delayed action to cleanup after the animation (based on the groups interval.) This feels like a hack though. Is there a better way? I don't have a

NSTask not cleaning up it's threads

2008-10-14 Thread C Tearpak
Hi there all, I am relatively new, and from what I can tell, I am doing the following correctly using GC (required) on my XCode Project. The following is a test application that demonstrates what I am seeing. If you look at the application in Activity monitor, you will see the threads go up

NSDistributedNotificationCenter

2008-10-14 Thread randy chapel
Hi, Has anyone had any luck using a NSDistributedNotificationCenter in a prefpane? code: in using the pref pane example from apple (http://developer.apple.com/samplecode/PrefsPane/index.html), I used the following code in the mainViewDidLoad method. NSDistributedNotificationCenter *center =

NSDistributedNotificationCenter in a prefpane?

2008-10-14 Thread randy chapel
Hi, has anyone been able to get a NSDistributedNotificationCenter (send/rec) to work within a prefpane? Randy ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Targetting 10.4

2008-10-14 Thread Louis Demers
Hi, I developed (on 10.5.5 with the latest tools) a small app that runs well on 10.5 and cleaned it up for 10.4. I configured my project with Base SDK to 10.4 as below, cleaned all and built a release binary. inline: Picture 1.gif Yet when I run it on 10.4.11, I get = Tuesday,

Re: Targetting 10.4

2008-10-14 Thread James Walker
Louis Demers wrote: I developed (on 10.5.5 with the latest tools) a small app that runs well on 10.5 and cleaned it up for 10.4. I configured my project with Base SDK to 10.4 as below, cleaned all and built a release binary. When you said I configured my project I wondered whether you

Re: [Obj-C Compiler Bug?] Two different classes declaring a message with the same name - compiler warning

2008-10-14 Thread Greg Parker
Chris Suter wrote: The proper way to solve this, in my opinion, is to allow a way of specifying that the return type varies depending on the class it's implemented on i.e. define the alloc method in such a way so that the compiler knows that -[class alloc] returns an object of type class.

Re: Targetting 10.4

2008-10-14 Thread Louis Demers
On 14-Oct-08, at 21:20 , James Walker wrote: Louis Demers wrote: I developed (on 10.5.5 with the latest tools) a small app that runs well on 10.5 and cleaned it up for 10.4. I configured my project with Base SDK to 10.4 as below, cleaned all and built a release binary. When you

Re: Not so long filenames

2008-10-14 Thread Chris Suter
On Wed, Oct 15, 2008 at 7:00 AM, Gerriet M. Denkmann [EMAIL PROTECTED] wrote: So again my question: why it is too long in this context and where is this documented? This looks like a bug in the kernel code. It looks like it checks the UTF8 string length against kHFSPlusMaxFileNameChars (rather

Re: Animating view transitions with Core Animation (problems with BasicCocoaAnimations sample)

2008-10-14 Thread Ken Ferry
On Mon, Oct 13, 2008 at 3:51 PM, Jim Correia [EMAIL PROTECTED] wrote: - Animation for -replaceSubview:with: appears to require a layer backed view tree. This is true. Also true of animations for hiding or adding or removing views. - Focus rings are drawn incorrectly for editable

-[NSGarbageCollection disableCollectorForPointer:] ?

2008-10-14 Thread Michael Link
I have a situation where I create an NSPointerArray on the stack by: pointers = [NSPointerArray pointerArrayWithOptions:NSPointerFunctionsStrongMemory| NSPointerFunctionsOpaqueMemory|NSPointerFunctionsOpaquePersonality]; I then go about adding a few objects a selector and a pointer

Re: NSTask not cleaning up it's threads

2008-10-14 Thread Ken Thomases
On Oct 14, 2008, at 6:43 AM, C Tearpak wrote: The following is a test application that demonstrates what I am seeing. If you look at the application in Activity monitor, you will see the threads go up every second. Is there something that I am missing? For a long-running application that

Re: EXC_BAD_ACCESS with NSAutoReleasePool, NSThread and NSThreadWillExitNotification

2008-10-14 Thread Ken Thomases
I realize you've already identified the cause of the crash but... On Oct 14, 2008, at 9:38 AM, John Zorko wrote: ... and the threadStopped method does this: - (void)threadStopped { NSLog(@*** streamer thread has stopped ***); [[NSNotificationCenter defaultCenter]