Re: best practice to create Custom Objects represented by a image in a d-n-d operation

2008-12-09 Thread Gustavo Pizano
Go for option #1, use a custom drag type (in your case ships) to pasteboard. aha ok understood that part. I think I know how to do it, shouldn't be different form registering a tiff representation of an image just register the NSData of the custom object no? You could update the

Re: best practice to create Custom Objects represented by a image in a d-n-d operation

2008-12-09 Thread Gustavo Pizano
On 9.12.2008, at 0:01, Graham Cox wrote: Use a custom drag type for your ship objects. Definitely DO NOT use image size as a way to identify the ship! That's just weird. Learn about MVC (Model-View-Controller). Your ship objects are part of the model, which could include a list of

Re: Another NSOutlineView question

2008-12-09 Thread Volker in Lists
Hi, you should be able to detect a double click and call a method then that either temporarily allows the selection or directly starts the edit mode. I do have a similar setup - don't do editing, but I use the double click action via bindings to attach notes to such an unselectable item.

Re: NSAlert with NSTimer

2008-12-09 Thread rajesh
I did something like this , long time back hope, this is close enough to your requirement or may be its a wrong practice ( user discretion required :) ) -()runAlert { ..// show modal window NSTimer *myTimer = [[NSTimer scheduledTimerWithTimeInterval:someTime target:self

NSAlert with NSTimer

2008-12-09 Thread Rashmi Vyshnavi
Hi, I want to close a Modal NSAlertPanel after specific period of time if user does not click on any of the buttons. Is there a way to set up a NSTimer to close the Alert Panel after 10 secs. -- Thanks.. ___ Cocoa-dev mailing list

Re: NSAlert with NSTimer

2008-12-09 Thread Rashmi Vyshnavi
I am using NSAlert. When runModal is called on the NSAlert's object, timer is not fired till the time i close the alert panel.. On Tue, Dec 9, 2008 at 3:20 PM, rajesh [EMAIL PROTECTED] wrote: I did something like this , long time back hope, this is close enough to your requirement or may be

Re: NSArrayController, NSPopupMenu, defaults and arrangedObjects

2008-12-09 Thread Steven Hamilton
snip However, the arrangedObjects array, while existing, contains zero objects. I've checked the Outlet is connected ok. A timing issue of some sort? No. Based on the above, your code isn't KVO compliant. First of all, it's important to realize that nothing is ever bound to an instance

Re: iPhone Orientation

2008-12-09 Thread Roland King
no longer a violation of the NDA provided you're discussing publicly released software, as the new NDA states; as far as I understand it. You may or may not have better luck over the iPhone dev forums, there's a couple of great people over there who are very good at answering the iPhone

Re: NSArrayController, NSPopupMenu, defaults and arrangedObjects

2008-12-09 Thread Volker in Lists
Hi Steven, as far as I know, the fect happens in the next run loop. So you would need to set the selection then. This is possible for example via the performSelector:withObject:afterDelay: and a delay of 0.0 on self (?). Cheers, Volker Ah, I understand. I've implemented the

Re: Optimized image drawing (currently using CGImageCreate - CGContextDrawImage)

2008-12-09 Thread Matthew Johnson
As far as I remember, you can get something like 1000 512x512 image draw per sec on a mac pro (not a very good card, but not bad also). If you use OpenGL instead of CoreGraphics, this is more like 7000 1024x768 image per sec. Did you have QuartzGL turned on when you tested this? Matthew

Development workflows for signed code?

2008-12-09 Thread Jack Repenning
I'm just dipping my toes into the world of signed code. After spending some time with the Code Signing guide, I'm still not clear on how this affects the work flows around my product (SCPlugin, http://scplugin.tigris.org , which adds Subversion capabilities to Finder), partly because of

Re: Development workflows for signed code?

2008-12-09 Thread Jean-Daniel Dupas
Le 9 déc. 08 à 05:12, Jack Repenning a écrit : I'm just dipping my toes into the world of signed code. After spending some time with the Code Signing guide, I'm still not clear on how this affects the work flows around my product (SCPlugin, http://scplugin.tigris.org , which adds

[Moderator] Re: Design patterns: MVC, MVP, Passive View... where is Apple heading???

2008-12-09 Thread Scott Anguish
On 9-Dec-08, at 8:36 AM, Karan, Cem (Civ, ARL/CISD) wrote: To lay the groundwork for this question, I'm going to state that I'm getting my definitions for MVC, MVP, and Passive View from the following: http://en.wikipedia.org/wiki/Model-view-controller

Re: NSAlert with NSTimer

2008-12-09 Thread Sherm Pendley
The +scheduledTimer* methods schedule the timer using the default runloop mode. Try creating a timer without scheduling it, then adding it yourself to the current runloop with NSRunLoop's -addTimer:forMode: instead, using the NSModalPanelRunLoopMode mode: myTimer = [NSTimer

Issue with the preference window

2008-12-09 Thread Arnab Ganguly
Hi All, I am trying out for the preference window.It is a simple app, and under the main menu when I click on the preference it shows the preference menu popup. But when I quit the preference window my app seemed to getting hang.I am not able to quit the application and also the main menu also

Re: NSTask and environment variables

2008-12-09 Thread Jean-Daniel Dupas
Le 9 déc. 08 à 11:51, Ingvar Nedrebo a écrit : On Dec 9, 2008, at 00:43, Chris Idou wrote: I want to call a script with NSTask and I want to set an environment variable. But it seems like bad form to blow away the current environment. So I guess I need to read the current environment and

Re: NSTask and environment variables

2008-12-09 Thread Ingvar Nedrebo
On Dec 9, 2008, at 00:43, Chris Idou wrote: I want to call a script with NSTask and I want to set an environment variable. But it seems like bad form to blow away the current environment. So I guess I need to read the current environment and extend it before passing it to NSTask. Is

Re: NSAlert with NSTimer

2008-12-09 Thread Rashmi Vyshnavi
It worked after adding timer in NSModalPanelRunLoopMode.Thanks On Tue, Dec 9, 2008 at 3:46 PM, Sherm Pendley [EMAIL PROTECTED]wrote: The +scheduledTimer* methods schedule the timer using the default runloop mode. Try creating a timer without scheduling it, then adding it yourself to the

Design patterns: MVC, MVP, Passive View... where is Apple heading???

2008-12-09 Thread Karan, Cem (Civ, ARL/CISD)
To lay the groundwork for this question, I'm going to state that I'm getting my definitions for MVC, MVP, and Passive View from the following: http://en.wikipedia.org/wiki/Model-view-controller http://en.wikipedia.org/wiki/Model_View_Presenter

Re: Implementing Delete key event

2008-12-09 Thread Gregory Weston
Mahaboob wrote: Hi all, In my application NSPopUpButton shows the table names in the database. When I'm pointing one table name and hitting delete key, I need to delete the table from the database. How can I implement delete key event for PopUp Button? If I'm understanding correctly

Re: Development workflows for signed code?

2008-12-09 Thread Chris Suter
On Tue, Dec 9, 2008 at 4:12 AM, Jack Repenning [EMAIL PROTECTED] wrote: My experiments so far seem to show that none of those things happens. In fact, even if I modify one of the files, so that codesign -v no longer likes the bundle, it still seems to work. Is codesign -v the only (Leopard)

Re: ASLExpireTime Format? [Solved, somewhat]

2008-12-09 Thread Karl Moskowski
So, I think I know why ASLExpireTime had no effect on the making messages persist in the main database. It looks like syslogd has to be started with the -a flag to enable archiving. When I added the flag to the ProgramArguments section of /

Re: Printing File to PDF from Native Application

2008-12-09 Thread Scott Ribe
There is no reliable documented API for switching the default printer. There are workarounds which might or might not work in the future. Briefly: there are CUPS techniques for setting the default printer. Under 10.4 these worked. Under 10.5 these work unless the user has chosen Last Printer in

Re: How Can I Notify DrawRect Method?

2008-12-09 Thread Nick Zitzmann
On Dec 9, 2008, at 9:17 AM, Chunk 1978 wrote: that works... but now i want that rect to redraw itself when notified to do so, but i can't figure out how to notify the NSRect to draw again... all my NSUserDefaults colorAsData is in place, as well as my NSNotifications. it will print to NSLog

Re: Text Not Anti-Aliased In NSView

2008-12-09 Thread Nick Zitzmann
On Dec 9, 2008, at 9:21 AM, Chunk 1978 wrote: this link ( http://att.macrumors.com/attachment.php?attachmentid=147663d=1228770137 ) will show you an image displaying this problem. the window on the left is from within Interface Builder (anti-aliased text), the window on the right is the

Best way to do hit testing on an image?

2008-12-09 Thread Karan, Cem (Civ, ARL/CISD)
I am in the process of creating a new interface for my program, which, for lack of any good comparison, can be thought of as a 2D scrolling game with a bunch of clickable sprites. I need to do hit testing to see if particular bitmaps have been clicked on. I have the following information

Re: How Can I Notify DrawRect Method?

2008-12-09 Thread rajesh
On Dec 9, 2008, at 5:17 PM, Chunk 1978 wrote: i'm assuming this is simple, but i can't solve the problem. at launch of the application, an NSRect is drawn with a userdefault color: -=-=-=-=- - (void)drawRect:(NSRect)rect { NSUserDefaults *defaults = [NSUserDefaults

Re: Right way to implement contextual menu in table/outline view?

2008-12-09 Thread Corbin Dunn
Le Dec 8, 2008 à 8:12 PM, Graham Cox a écrit : On 9 Dec 2008, at 2:56 pm, Jim Correia wrote: On Dec 8, 2008, at 10:51 PM, Graham Cox wrote: In my app I have an NSOutlineView. I have contextual menus relating to the overall table, but also relating to an individual item row. I notice

Re: How Can I Notify DrawRect Method?

2008-12-09 Thread Chunk 1978
i hadn't tried setNeedsDisplay:YES... but this works... and now i know what setNeedsDisplay means, which is exciting :) thanks everyone. On Tue, Dec 9, 2008 at 11:27 AM, rajesh [EMAIL PROTECTED] wrote: On Dec 9, 2008, at 5:17 PM, Chunk 1978 wrote: i'm assuming this is simple, but i can't

Re: Another NSOutlineView question

2008-12-09 Thread Corbin Dunn
Le Dec 9, 2008 à 12:40 AM, Volker in Lists a écrit : Hi, you should be able to detect a double click and call a method then that either temporarily allows the selection or directly starts the edit mode. I do have a similar setup - don't do editing, but I use the double click action via

Re: How Can I Notify DrawRect Method?

2008-12-09 Thread I. Savant
On Tue, Dec 9, 2008 at 11:17 AM, Chunk 1978 [EMAIL PROTECTED] wrote: that works... but now i want that rect to redraw itself when notified to do so, but i can't figure out how to notify the NSRect to draw again... all my NSUserDefaults colorAsData is in place, as well as my NSNotifications.

Re: The thread that starts by NSTask didn't clear up

2008-12-09 Thread Etienne Guérard
I started an AP use NSTask in my project ,when I loaded this AP, thread count will be increased ,after sending apple event to AP , and AP will exit, but thread count can't decrease. If I used this method load AP more times, thread count will increased, but there was no problem on tiger,

How to launch window of the application on clicking of dock icon?

2008-12-09 Thread Arun
Hi, I have created a simple application in cocoa. when it is ran, the main window appears and a default dock icon in the Dock. If i close the window, the dock icon still stays. But if i click on the dock icon then also the main window is visible. The only way i can see the main window is by

Re: How to launch window of the application on clicking of dock icon?

2008-12-09 Thread Josh Abernathy
In your app delegate, implement -applicationDidBecomeActive: to show your window. On Dec 9, 2008, at 12:02 PM, Arun wrote: Hi, I have created a simple application in cocoa. when it is ran, the main window appears and a default dock icon in the Dock. If i close the window, the dock icon

Re: How to launch window of the application on clicking of dock icon?

2008-12-09 Thread Benjamin Dobson
On 9 Dec 2008, at 17:02:19, Arun wrote: Hi, I have created a simple application in cocoa. when it is ran, the main window appears and a default dock icon in the Dock. If i close the window, the dock icon still stays. But if i click on the dock icon then also the main window is visible.

Fwd: Text Not Anti-Aliased In NSView

2008-12-09 Thread Chunk 1978
-- Forwarded message -- From: Chunk 1978 [EMAIL PROTECTED] Date: Tue, Dec 9, 2008 at 12:34 PM Subject: Re: Text Not Anti-Aliased In NSView To: Nick Zitzmann [EMAIL PROTECTED] i studied apple's Basic Cocoa Animations example found here:

Accessing NSKeyedArchiver's archivedDataWithRootObject by name

2008-12-09 Thread Jim Turner
I have a situation where I'm archiving an array of objects via NSKeyedArchiver's archivedDataWithRootObject: and later needing to set a delegate on the NSKeyedUnarchiver that decodes it. The documentation is a bit unclear on how one starts the unarchive process when a NSKeyedUnarchiver is created

Re: performance problem with IORegistryEntryCreateCFProperties

2008-12-09 Thread Raleigh Ledet
I totally agree with Herb here. If matching on a specific serial number is not feasible, at the very least, match on the IOHIDDevicesKey. As opposed to polling, you will be informed with the HID topology changes. One very important note though. I would avoid calling

Quote in path name

2008-12-09 Thread David Blanton
The following returns a nil image with a path of lg002025-Santa.tif NSImage *image = [[NSImage alloc] initWithContentsOfFile:path]; bool ok = [image isValid]; but returns a valid image if the path is lg002025-Santa.tif so how can the finder allow in the name but NSImage burps

Re: How to launch window of the application on clicking of dock icon?

2008-12-09 Thread Raleigh Ledet
This depends on your application. A document based application will automatically create a new untitled document for you. Which is generally what you want. If you app is really document based, its best to use the document based project template. If you app is not document based (say Mail

Re: NSNumberFormatter strange symbols on PPC/10.4

2008-12-09 Thread Stéphane BARON
I did encounter the same problem (developing on 10.5 and testing on 10.4) It seem's to be a know bug in NSNumberFormatter I solved it by subclassing NSNumberFormatter like this: #import MCNumberFormatter.h @implementation MCNumberFormatter - (NSString *)stringForObjectValue:(id)anObject {

Re: Quote in path name

2008-12-09 Thread Charles Steinman
It works for me. How is the string for path getting created? Cheers, Chuck - Original Message From: David Blanton [EMAIL PROTECTED] To: Cocoa-dev List cocoa-dev@lists.apple.com Sent: Tuesday, December 9, 2008 10:32:19 AM Subject: Quote in path name The following returns a nil

NSArrayController with a base class

2008-12-09 Thread Todd Heberlein
Hi all, I'm looking for documentation/tutorial/pointers on how to handle the situation when an NSArrayController is managing an NSMutableArray which will contain multiple types of objects but all of which have the same base class. So the NSArrayController's Object Controller Class Name

NSTextField in a sheet and focus

2008-12-09 Thread Mike Chambers
I have a sheet which contains an NSTextField. I need to allow users to enter line returns in the textfield, so I have implemented the functionality according to this apple note: http://developer.apple.com/qa/qa2006/qa1454.html This works great. However, if the user clicks out of the text field

Re: Development workflows for signed code?

2008-12-09 Thread Jack Repenning
On Dec 9, 2008, at 6:36 AM, Chris Suter wrote: By the way, you should post code signing questions to the apple-cdsa list rather than the Cocoa list as you'll get a better response there. Thanks for that. I did look for a more focused list, but I guess that acronym didn't catch my eye.

NSTextField + Drag'n'Drop

2008-12-09 Thread Jean-Nicolas Jolivet
I'm trying to subclass NSTextField so that it accepts dragged directory from the Finder... (I know it already does, but I need to modify the behavior slightly)... Instead of inserting the dragged file's path in the current text of the text field, I need to replace the whole textfield's

Re: Text Not Anti-Aliased In NSView

2008-12-09 Thread Peter Ammon
On Dec 9, 2008, at 8:21 AM, Chunk 1978 wrote: i have several views that are added and replaced by a main window using core animation... i've noticed that the text (label objects, checkbox text, etc.) in each view is not being anti-aliased. this link (

Multithreading and Mach ports

2008-12-09 Thread John Love
Reference: http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/RunLoopManagement/chapter_6_section_5.html#/ /apple_ref/doc/uid/1057i-CH16-SW7 I've got several questions since I'm just starting to investigate Mach Ports. 1) Why is +LaunchThreadWithPort: so

Re: Quote in path name

2008-12-09 Thread Charles Steinman
Can you not recreate the bug in testing or identify the code where the possibly faulty path variable is created? Cheers, Chuck - Original Message From: David Blanton [EMAIL PROTECTED] To: Charles Steinman [EMAIL PROTECTED] Sent: Tuesday, December 9, 2008 11:50:26 AM Subject: Re:

Re: Multithreading and Mach ports

2008-12-09 Thread Jean-Daniel Dupas
Le 9 déc. 08 à 21:36, John Love a écrit : Reference: http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/RunLoopManagement/chapter_6_section_5.html#/ /apple_ref/doc/uid/1057i-CH16-SW7 I've got several questions since I'm just starting to investigate Mach Ports.

Setting company checkbox programatically in an AddressBook

2008-12-09 Thread development2
I am having a problem setting the Checkbox to show the address book item is for a company. It seems to crash settig the value. What am I doing wrong? // we need to create this address item addressItem = [[[ABPerson alloc] init] autorelease]; [addressItem

Creating a window when pressing a button

2008-12-09 Thread Jushin
In my application, I have to open a form window when a user press a button. It is somewhat similar to Apple Mail. In Apple Mail, if you click New Message button from the toolbar, a New Message window is appeared. For now, what I did was something like this: In IB, I added a window (or a panel),

Re: Setting company checkbox programatically in an AddressBook

2008-12-09 Thread Nick Zitzmann
On Dec 9, 2008, at 2:18 PM, development2 wrote: int personFlags = [[addressItem valueForProperty:kABPersonFlags] intValue]; That should be an NSInteger, not an int, and you should use - integerValue instead. personFlags = (kABShowAsMask kABShowAsCompany); That

Re: Setting company checkbox programatically in an AddressBook

2008-12-09 Thread development2
On Dec 9, 2008, at 2:31 PM, Nick Zitzmann wrote: On Dec 9, 2008, at 2:18 PM, development2 wrote: int personFlags = [[addressItem valueForProperty:kABPersonFlags] intValue]; That should be an NSInteger, not an int, and you should use - integerValue instead. Yeah thanks, saw that in

Cocoaheads Lake Forest (92630) meeting 11/12/2008 at 7 pm on Using and optimizing Core Data in a commercial application

2008-12-09 Thread Scott Ellsworth
Hello, all, CocoaHeads Lake Forest will be meeting on the second Wednesday in December, 12/10, from 7 to 9 PM. We will meet in our usual location at the Orange County Public Library (El Toro) community room, 24672 Raymond Way, Lake Forest, CA 92630. Peter Hosey, one of the developers of the

Correction: Cocoaheads Lake Forest (92630) meeting 12/10/2008 at 7 pm on Adding Unit Tests to a Cocoa Application

2008-12-09 Thread Scott Ellsworth
Please note corrected subject. Hello, all, CocoaHeads Lake Forest will be meeting on the second Wednesday in December, 12/10, from 7 to 9 PM. We will meet in our usual location at the Orange County Public Library (El Toro) community room, 24672 Raymond Way, Lake Forest, CA 92630. Peter Hosey,

NSUserDefaults and valueForKeyPath ?

2008-12-09 Thread Arthur C.
I've been busy adding some structure to the NSUserDefaults in my app. So I would have a dictionary like 'generalPrefs' with some key/value pairs, separate from 'otherPrefs' etc. Now I wonder why the following doesn't work: [[NSUserDefaultsController sharedUserDefaultsController] valueForKeyPath:

How to detect a paste request for file copy/paste?

2008-12-09 Thread Ling Li
I want to implement a delayed file paste feature for file copy/paste. When I first put file lists into the clipboard, the files are actually not existing yet (in another unmapped network place). These files will only be created after got the paste request. So my question is how to detect the

Re: Accessing NSKeyedArchiver's archivedDataWithRootObject by name

2008-12-09 Thread Michael Ash
On Tue, Dec 9, 2008 at 1:17 PM, Jim Turner [EMAIL PROTECTED] wrote: I have a situation where I'm archiving an array of objects via NSKeyedArchiver's archivedDataWithRootObject: and later needing to set a delegate on the NSKeyedUnarchiver that decodes it. The documentation is a bit unclear on

Re: Quote in path name

2008-12-09 Thread David Blanton
Ok, my problem! We have some C++ code that preprocess our paths (for our reasons) and it was REMOVING the , duh, sorry! But I did learn something. Some names come in with some UTF8 encoding and those were a problem until I realized stringWithUTF8Encoding. On Dec 9, 2008, at 1:45 PM,

Re: How Can I Notify DrawRect Method?

2008-12-09 Thread I. Savant
Even if it were slower, contorting the code like this without having profiled the code and demonstrated that this is in fact a significant slowdown is bad practice. I disagree. Certainly it's profile first, but to have a view that reads a simple property from user defaults every time it

Re: Another NSOutlineView question

2008-12-09 Thread Graham Cox
On 10 Dec 2008, at 3:34 am, Corbin Dunn wrote: Le Dec 9, 2008 à 12:40 AM, Volker in Lists a écrit : Hi, you should be able to detect a double click and call a method then that either temporarily allows the selection or directly starts the edit mode. I do have a similar setup - don't do

problems debugging cocoa app w/ gdb

2008-12-09 Thread kvic...@pobox.com
for sometime now (i don't remember when this started, possibly w/ leopard or 10.5.5 or the previous dev tools update), i've been getting a number of lines like the following on the debugger console when hitting breakpoints: warning: Trying to look up NSString in 'this' but 'this' is not an

commitEditing and unrecognized selector

2008-12-09 Thread Chris Idou
I've got a modal dialog with a couple of NSTextFields. Changes weren't getting saved, so I thought I'd better call commitEditing on the text field before retrieving its value with stringValue. But when I call commitEditing on the NSTextField it gives the error: -[NSTextField commitEditing]:

Re: commitEditing and unrecognized selector

2008-12-09 Thread Graham Cox
On 10 Dec 2008, at 10:53 am, Chris Idou wrote: I've got a modal dialog with a couple of NSTextFields. Changes weren't getting saved, so I thought I'd better call commitEditing on the text field before retrieving its value with stringValue. But when I call commitEditing on the NSTextField

Re: Another NSOutlineView question

2008-12-09 Thread Corbin Dunn
Le Dec 9, 2008 à 3:36 PM, Graham Cox a écrit : On 10 Dec 2008, at 3:34 am, Corbin Dunn wrote: Le Dec 9, 2008 à 12:40 AM, Volker in Lists a écrit : Hi, you should be able to detect a double click and call a method then that either temporarily allows the selection or directly starts

Re: commitEditing and unrecognized selector

2008-12-09 Thread Sean McBride
On 2008-Dec-9, at 18:53, Chris Idou wrote: I've got a modal dialog with a couple of NSTextFields. Changes weren't getting saved, so I thought I'd better call commitEditing on the text field before retrieving its value with stringValue. But when I call commitEditing on the NSTextField it

Re: Another NSOutlineView question

2008-12-09 Thread Graham Cox
On 10 Dec 2008, at 11:02 am, Corbin Dunn wrote: Actually, I think the row does have to be selected to allow it to be edited. Is there a reason you can't let it be selected at this point? In other words, what are you trying to do? I may be able to offer another solution. OK. The

Symbol not found error

2008-12-09 Thread Daniel Luis dos Santos
Hello, I am getting this error over and over again, whenever I do a new target in some place and then try to use it somewhere else. I have a dynamic library in a project that is used in another project. Then I added another dynamic library to the first one which is also used by the second

Re: performance problem with IORegistryEntryCreateCFProperties

2008-12-09 Thread Brad Justice
First, I would like to thank all those who took the time to assist me with this issue. I have begun implementing the suggestions I received with good results. Modifying the code to use IORegistryEntryCreateCFProperty() rather than IORegistryEntryCreateCFProperties() resulted in CPU usage

Re: How Can I Notify DrawRect Method?

2008-12-09 Thread Ricky Sharp
On Dec 9, 2008, at 5:31 PM, I. Savant wrote: Even if it were slower, contorting the code like this without having profiled the code and demonstrated that this is in fact a significant slowdown is bad practice. I disagree. Certainly it's profile first, but to have a view that reads a

Custom NSTableView cells

2008-12-09 Thread Randall Meadows
I could use a little guidance, please, on customizing cells for display in an NSTableView. (My app is Leopard-only.) I looked around the Apple docs and cocoadev, but didn't really find anything useful. Other pointers would be appreciated. My table has but one column, but each cell in

Re: How Can I Notify DrawRect Method?

2008-12-09 Thread I. Savant
On Dec 9, 2008, at 8:09 PM, Ricky Sharp wrote: In some cases, other attributes, when set, will 'dirty' that flag followed by a setNeedsDisplay. Colors will then be re-fetched/ created and then reused until the next change comes along. Perfectly good example of timely optimization. The

Re: The thread that starts by NSTask didn't clear up

2008-12-09 Thread Xianyu_Ge
thanks for your reply. I means in my project, I want to use NSTask to launch an application, and send application some parameters, when use NSTask launch application that will add a new thread, right? and then send Apple event, when application received Apple event , it will quit, usually,

Re: How Can I Notify DrawRect Method?

2008-12-09 Thread Ricky Sharp
On Dec 9, 2008, at 7:25 PM, I. Savant wrote: On Dec 9, 2008, at 8:09 PM, Ricky Sharp wrote: In some cases, other attributes, when set, will 'dirty' that flag followed by a setNeedsDisplay. Colors will then be re-fetched/ created and then reused until the next change comes along.

-[NSManagedObject reallyIsDeleted]?

2008-12-09 Thread Nick Zitzmann
I searched the archives and didn't see anything relevant... The -[NSManagedObject isDeleted] method incorrectly returns false if the object has been deleted. This is in the documentation, despite the misleading name, but how do I find out if an NSManagedObject has really been deleted?

Re: Custom NSTableView cells

2008-12-09 Thread Graham Cox
On 10 Dec 2008, at 12:21 pm, Randall Meadows wrote: I could use a little guidance, please, on customizing cells for display in an NSTableView. (My app is Leopard-only.) I looked around the Apple docs and cocoadev, but didn't really find anything useful. Other pointers would be

Re: How Can I Notify DrawRect Method?

2008-12-09 Thread Graham Cox
On 10 Dec 2008, at 12:25 pm, I. Savant wrote: Asking for the shared user defaults instance, then asking it for a value, then unarchiving a more useful object from it, *then* using it to draw is certainly more work than caching the value only when it changes. It's not like it's performance

Re: Creating a window when pressing a button

2008-12-09 Thread Damien Cooke
Jushin, What I have done in the past with these sort of issues is either load the nib in the button pushed action or depending on how complicated your secondary window is, you could programatically create it like this. myWindow = [[NSWindow alloc] initWithContentRect:myRect

Re: About NSAppleScriptErrorNumber = -2709

2008-12-09 Thread xiaobin
Thanks for your reply, Rob I found the following site had the same problem (using an Apple Script) to mine. http://lists.apple.com/archives/cocoa-dev/2003/Dec/msg00563.html In my App A I also use the Security Framework to authenticate the user to elevate privilege because my App B must be run

Re: Custom NSTableView cells

2008-12-09 Thread j o a r
On Dec 9, 2008, at 6:21 PM, Randall Meadows wrote: I could use a little guidance, please, on customizing cells for display in an NSTableView. (My app is Leopard-only.) I looked around the Apple docs and cocoadev, but didn't really find anything useful. Other pointers would be

Re: Creating a window when pressing a button

2008-12-09 Thread Damien Cooke
Jushin, Here is an example loading from nib within an action method - (IBAction)showMyNewWindow:(id)sender { NSLog(@Loading Nib); if(!myNewWindow) { [NSBundle loadNibNamed:@MyNewWindow owner:self]; } [myNewWindow makeKeyAndOrderFront:nil];

Re: NSArrayController with a base class

2008-12-09 Thread Rob Rix
I’m doing something vaguely similar to this using a subclass of NSCollectionView, which sets up the collection view item differently depending on some attribute of the represented object it’s operating on. In this case, the class is just another attribute. NSArrayController being in the

Re: Creating a window when pressing a button

2008-12-09 Thread Rob Rix
It sounds like you might want to set up the window in a new nib file, which you load and unload with NSWindowController by creating a new NSWindowController instance and then calling -showWindow: on it. This also gives you a convenient location to start adding controller code for the

Re: How Can I Notify DrawRect Method?

2008-12-09 Thread Michael Ash
On Tue, Dec 9, 2008 at 6:31 PM, I. Savant [EMAIL PROTECTED] wrote: Even if it were slower, contorting the code like this without having profiled the code and demonstrated that this is in fact a significant slowdown is bad practice. I disagree. Certainly it's profile first, but to have a

Re: Symbol not found error

2008-12-09 Thread Sean McBride
Daniel Luis dos Santos ([EMAIL PROTECTED]) on 2008-12-10 7:38 PM said: I am getting this error over and over again, whenever I do a new target in some place and then try to use it somewhere else. I have a dynamic library in a project that is used in another project. Then I added another dynamic

Re: How Can I Notify DrawRect Method?

2008-12-09 Thread Michael Ash
On Tue, Dec 9, 2008 at 8:25 PM, I. Savant [EMAIL PROTECTED] wrote: On Dec 9, 2008, at 8:09 PM, Ricky Sharp wrote: In some cases, other attributes, when set, will 'dirty' that flag followed by a setNeedsDisplay. Colors will then be re-fetched/created and then reused until the next change

Re: How Can I Notify DrawRect Method?

2008-12-09 Thread Sean McBride
I. Savant ([EMAIL PROTECTED]) on 2008-12-09 8:25 PM said: Asking for the shared user defaults instance, then asking it for a value, then unarchiving a more useful object from it, *then* using it to draw is certainly more work than caching the value only when it changes. It's not like it's

Re: Another NSOutlineView question

2008-12-09 Thread Graham Cox
On 10 Dec 2008, at 11:21 am, Graham Cox wrote: I did also try the idea of using an active marker in a separate table column to indicate the active layer and that worked alright, but much less obvious and visible than using the selection highlight for this. It also added another column to

Re: How to use NSWorkspace?

2008-12-09 Thread Nathan Day
You probable do not have AppKit include into you command line tool (under the 'External Frameworks and Libraries' folder) either add it to your project or look at LaunchServices which is easy to use, I have an example/wrapper on my web site. On 08/12/2008, at 11:07 , John Velman wrote:

Re: How to launch window of the application on clicking of dock icon?

2008-12-09 Thread Arun
Thanks for the reply. My app is not a document based. I tried using the applicationDidBecomeActive to bring up my main window. It works only when my application is not active. i.e., when the MenuBar is occupied by other application. If i launch my app and close the window, the menu bar is still

Re: Fix for Core Data + NSTreeController + NSOutlineView Crashes?

2008-12-09 Thread Bill Monk
Has anyone ever found a way to use Core Data + NSTreeController + NSOutlineView without getting crashes during undo? Try setting an isLeaf leaf keypath on the tree controller in IB and add a Boolean isLeaf attribute in the data model. When I do that here, AbstractTree and similar examples

Re: Multithreading and Mach ports

2008-12-09 Thread Nathan Day
On 10/12/2008, at 07:36 , John Love wrote: Reference: http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/RunLoopManagement/chapter_6_section_5.html#/ /apple_ref/doc/uid/1057i-CH16-SW7 I've got several questions since I'm just starting to investigate Mach Ports.

Get Info via OS X UI on app with changed version data still shows old value, unless copied, then it works

2008-12-09 Thread Chris Markle
Confused here about where Get Info on an app bundle gets its info... I'm sure this is basic stuff for you guys, but I'm relatively new at this. I have a directory called say AppDir with an application bundle in it called App1. I altered the various version strings and what-not in App1/Info.plist

Re: Design patterns: MVC, MVP, Passive View... where is Apple heading???

2008-12-09 Thread Nathan Day
I have seen that version of the MVC pattern a lot where the View and Model are directly connected sometimes only one way, never really understood how it was supposed to work, my understanding is that with cocoa the model and view where never directly connected to each and it was the