Making a text cell in a table editable

2008-07-09 Thread Chris Idou
How do I programmatically make a text cell in a NSTableView to have focus and be in edit mode? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the

Setting the color label

2008-07-09 Thread Chris Idou
I came up with the code below to set the color label. Questions: 1) Is it really necessary to do a FSGetCatalogInfo first? I presume it is because otherwise the FSSetCatalogInfo wouldn't know what fields of catalogInfo.finderInfo it is supposed to be updating, or even what bits of

Document based initial window.

2008-07-30 Thread Chris Idou
In a Cocoa document based application, how do you stop it from initially opening an empty document on start up? (I'm using a core data application if it matters). ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Doc based app - creating a document

2008-07-31 Thread Chris Idou
I've got a core-data document based app. I need to programmatically create or open a document at a programmatically chosen location and display it in a window. This is what I tried: [[NSDocumentController sharedDocumentController] makeDocumentWithContentsOfURL:url ofType:mytype error:error];

interrupting a thread/run loop

2008-08-01 Thread Chris Idou
In the Java thread API (which I am most familiar with) you put the thread in a wait() and then another thread can send the thread an interrupt() which makes it wake up and do stuff. I have a Cocoa thread waiting on events in a run loop. But I want to be able to give the waiting thread a kick

File's Owner problems

2008-08-05 Thread Chris Idou
I've got a class, let's call it Foo, that loads a NIB called Bar. In IB, the File's owner of Bar is set to class Foo. When Foo loads Bar, passing self as the file's owner, Foo.awakeFromNib gets called during the nib loading process. Is that meant to happen? It doesn't make sense to me.

NSDocument opening folders

2008-08-05 Thread Chris Idou
I have a document based application that needs to be able to open folders. I'm calling: [[NSDocumentController sharedDocumentController] openDocument:myfolderurl ofType:@mytype display:YES error:error]; but I get the error: Error Domain=NSCocoaErrorDomain Code=256 UserInfo=0x10be490

NSPopupButton, Null Placeholder, image

2008-08-10 Thread Chris Idou
I've figured out how to have a little cog action menu using NSPopupButton. Now I want to have one where the items of the menu are dynamically changed using a binding. That works, but it destroys the little cog image. So then I notice the Null Placeholder option, which seems good because it

NSTokenField with plain text

2008-08-11 Thread Chris Idou
I've seen programs where a NSTokenField allows plain text interspersed with tokens. But when I use NSTokenField it insists on making all text that is entered to be part of a token. How do I restrict the set of allowable tokens and make anything else entered to be just plain text?

NSTokenField with plain text

2008-08-11 Thread Chris Idou
I've seen programs where a NSTokenField allows plain text interspersed with tokens. But when I use NSTokenField it insists on making all text that is entered to be part of a token. How do I restrict the set of allowable tokens and make anything else entered to be just plain text?

addObserver:

2008-08-11 Thread Chris Idou
I'm making the following call (and defining observeValueForKeyPath on self etc) on an NSArrayController, hoping to get notifications of it changing. But I don't seem to be getting any notifications. Should this work? [arrayController addObserver:self forKeyPath:@content

NSTokenField drag and drop

2008-08-12 Thread Chris Idou
I've got two NSTokenFields. One is read-only as a palette for dragging and dropping to the other. I've implemented a Token class to distinguish between tokens and plain text (NSString). I can pass in arrays of mixed Tokens and NSStrings, and it all displays correctly in both fields. However,

Is this how you can use bindings?

2008-08-13 Thread Chris Idou
I want a button to be enabled when myTextField is not empty. Can have an outlet in my controller called myTextField, and then set the Enabled binding on the button to point to myTextField.stringValue.length, then can I write a transformer called GreaterThanZero to return boolean if the input

Re: Is this how you can use bindings?

2008-08-13 Thread Chris Idou
? To: Chris Idou [EMAIL PROTECTED] Cc: cocoa-dev@lists.apple.com cocoa-dev@lists.apple.com Date: Tuesday, August 12, 2008, 11:56 PM The way to think about this is, you bind the value of the text field to a controller (or model) object that owns the value. Then, bind the enabled binding

This document's file has been changed by another application?

2008-08-19 Thread Chris Idou
I've got a document based app where the document is actually a directory. Every time I save except the first time I get the above error whether or not things have changed, and even if the directory timestamp is unchanged. Under what circumstances does the above message occur and how do I avoid

Re: This document's file has been changed by another application?

2008-08-19 Thread Chris Idou
Not sure exactly, but here's a thought: Are you deleting and re- creating the directory each time you save? No. How are you creating the folder? Are you using the NSDocument - fileWrapperOfType:error: method? The directory is pre-existing in this case. I'm not calling that method.

Re: This document's file has been changed by another application?

2008-08-20 Thread Chris Idou
operations, that might give a hint. The problem might also occur if you arbitrarily tweak the fileUrl. I'm not touching the fileUrl. I'm printing it out, and it remains the same as expected. -Chaitanya On 19-Aug-08, at 9:36 PM, Chris Idou wrote: I've got a document based app where

Model Object Validation

2008-08-20 Thread Chris Idou
I have a validation method on my object, managed by a NSObjectController. If I try and tab out of a field that is invalid I get a warning sheet - great. But if I just hit command-S to save, there is no message. I could of course tediously call every single validation method in my NSDocument's

filter Predicate - NSArrayController

2008-08-21 Thread Chris Idou
I want a search field aka iTunes to filter my NSTableView. I have a list of objects with a title field. The filter predicate of NSArrayController sounds like something that might help. I got as far as writing this predicate: return [NSComparisonPredicate

User Defaults - tables and arrays

2008-08-21 Thread Chris Idou
Is the User Defaults Controller any use if you have a table or array of objects to store? It's not obvious what one would bind to, or how one could control the tableview just using a user defaults controller. Is the User Defaults controller purely for simple stuff?

CFBoolean

2008-08-24 Thread Chris Idou
How do I create a property in the user defaults of type boolean? Internally it seems to use a NSCFBoolean which is an undocumented type. If I make the assumption it is the same as a CFBoolean, and overlooking the oddness of having to fall back to Carbon for such a fundamental thing, the

Re: CFBoolean

2008-08-24 Thread Chris Idou
--- On Sun, 8/24/08, Phil [EMAIL PROTECTED] wrote: http://developer.apple.com/documentation/Cocoa/Conceptual/PropertyLists/Articles/XMLPListsConcept.html I'm curious as to why you need a boolean, rather than just what -setBool:forKey: gives you? Because I have an array containing

core data hanging

2008-08-25 Thread Chris Idou
I've got a really simple application of core data. It's a document based application, but its not a NSPersistentDocument, because I have an opaque bundle/directory data format and the core data is only a tiny part of it. Its hanging on the call to: persistentStore = [persistentStoreCoordinator

NSUserDefaultsController and validation

2008-08-28 Thread Chris Idou
How do you validate when using NSUserDefaultsController, seeing as its values member is internal, and you can't write validateXYZ methods? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

activateIgnoringOtherApps

2008-08-31 Thread Chris Idou
I want to pop up a window in response to a hot key. So I'm creating a window, setting it makeKeyAndOrderFront, and I'm calling [NSApp activateIgnoringOtherApps] so that it gets focus. The thing is, activateIgnoringOtherApps seems to bring ALL my app's windows in front of other windows (my app

Re: activateIgnoringOtherApps

2008-08-31 Thread Chris Idou
in response to a hotkey. --- On Sun, 8/31/08, Ken Thomases [EMAIL PROTECTED] wrote: From: Ken Thomases [EMAIL PROTECTED] Subject: Re: activateIgnoringOtherApps To: [EMAIL PROTECTED] Cc: cocoa-dev@lists.apple.com Date: Sunday, August 31, 2008, 2:05 PM On Aug 31, 2008, at 8:48 AM, Chris Idou wrote

NSInvocation

2008-09-10 Thread Chris Idou
I have a need to call performSelector:withObject etc, except I need to pass 3 arguments. The doco to performSelector:withObject:withObject says to See NSInvocation, which I have done, but I don't understand how to use it. Can anyone give me some code which implements performSelector:withObject

Multiple Document types

2008-09-10 Thread Chris Idou
I have an app which can open and create multiple document types. With the standard framework, the New menu item seems to just create a document of one of those types. Am I supposed to write my own dialog box to ask the user what type of document they want to create, or is there something in the

New Core Data document

2008-09-11 Thread Chris Idou
I need to create a new core data document apart from the Core-data based document framework. (*) I can't pass nil to NSPersistentStoreCoordinator.addPersistentStoreWithType because that is an error. So how do I create an in-memory document until such time as it is saved and the user is

NSWindowController

2008-09-15 Thread Chris Idou
Sorry if this is a bit basic, but I can't figure out why my preference panel only comes up the first time. Second and subsequent times, nothing happens. I have this code linked to Preferences menu item: - (IBAction)preferences:(id)sender { if (nil == preferencesController) {

Re: NSWindowController

2008-09-15 Thread Chris Idou
@lists.apple.com cocoa-dev@lists.apple.com Date: Monday, September 15, 2008, 7:19 PM Your window might be set to release on close in IB, causing it to be deallocated instead of just ordered out when the user clicks its close button. -- Chris On Sep 15, 2008, at 6:55 PM, Chris Idou [EMAIL

Re: NSWindowController

2008-09-15 Thread Chris Idou
for? --- On Mon, 9/15/08, Graham Cox [EMAIL PROTECTED] wrote: From: Graham Cox [EMAIL PROTECTED] Subject: Re: NSWindowController To: [EMAIL PROTECTED] Cc: cocoa-dev@lists.apple.com Date: Monday, September 15, 2008, 8:22 PM On 16 Sep 2008, at 11:55 am, Chris Idou wrote: - (IBAction

Re: NSWindowController

2008-09-16 Thread Chris Idou
To: [EMAIL PROTECTED] Cc: cocoa-dev@lists.apple.com Date: Monday, September 15, 2008, 8:57 PM On 16 Sep 2008, at 1:44 pm, Chris Idou wrote: That fixes it, but I thought the owner in this case was the owner of the NSWindowController, not the File's owner of the NIB

Re: NSWindowController

2008-09-16 Thread Chris Idou
: NSWindowController To: [EMAIL PROTECTED] Cc: cocoa-dev@lists.apple.com Date: Monday, September 15, 2008, 9:50 PM On 16 Sep 2008, at 2:45 pm, Chris Idou wrote: I see. But if some other object was the File's Owner, then how would you link the Window to the window Outlet of the Window

Listening for changes in a table

2008-09-17 Thread Chris Idou
I've got a NSTableView controlled by an NSArrayController, which uses an array of NSMutableDictionaries as its controlled objects. One of the columns is a checkbox. These dictionaries are ultimately stored in the user's preferences. How would I get immediate notification if a user changed one

Re: Listening for changes in a table

2008-09-18 Thread Chris Idou
--- On Thu, 9/18/08, Ken Thomases [EMAIL PROTECTED] wrote: Two possibilities: * If you used a custom class rather than a dictionary, then there would be a setter of your own design called when the property is set due to a change in the checkbox. Yes I could do that, but given that

Re: NsPredicateEditor

2008-09-21 Thread Chris Idou
There's one or two demo apps on the apple site. I think it's called PredicateEditorSample. If the editor is totally empty on start you may have to initialise it with an empty NSCompoundPredicate so that you can at least see the add button. You can also search the archives for some tips. ---

Re: Listening for changes in a table

2008-09-21 Thread Chris Idou
the controller key to be a dotted value. Am I thinking about this wrong somehow? Can I get the bindings to listen to changes to values.files without having to proxy it through my own methods? --- On Thu, 9/18/08, Chris Idou [EMAIL PROTECTED] wrote: From: Chris Idou [EMAIL PROTECTED] Subject: Re

popup button wierdness

2008-09-25 Thread Chris Idou
I've got a NSPopupButton with a menu (A gear action menu), that has 7 items in it and working fine. But now if I click on the button in IB and remove one of the menu items by pressing Delete, then I rebuild and run the app, the whole popup button menu is frozen and doesn't work. If I undo

Re: Bindings Question

2008-09-25 Thread Chris Idou
Normally you would have the table controlled by a NSArrayController. You would bind the button to an action method which would take the value from the text field and pass it to addObject: method of the array controller. --- On Thu, 9/25/08, Eric Lee [EMAIL PROTECTED] wrote: From: Eric Lee

NSTokenField Drag and Drop

2008-09-28 Thread Chris Idou
I've got two NSTokenFields. One is read-only as a palette for dragging and dropping to the other. I've implemented a Token class to distinguish between tokens and plain text (NSString). I can pass in arrays of mixed Tokens and NSStrings, and it all displays correctly in both fields. However,

Files without an extension

2008-09-30 Thread Chris Idou
Does anyone know how OS-X and/or the Finder treats files without an extension? If I have a plain text file without an extension, then changing the program that opens txt files will make it change for plain text files without an extension. But if I have an RTF file without an extension, it

Just when I thought I understood bindings.

2008-10-08 Thread Chris Idou
I've got an NSObjectController controlling an object. This content object's properties are bound to various fields on my screen. It seems that the bindings are only working in one direction. Editing the fields updates the object, but programmatically updating the object doesn't update the

Re: Just when I thought I understood bindings.

2008-10-08 Thread Chris Idou
. To: Cocoa List cocoa-dev@lists.apple.com Date: Wednesday, October 8, 2008, 5:27 PM On 09/10/2008, at 10:21 AM, Chris Idou wrote: It seems that the bindings are only working in one direction. Editing the fields updates the object, but programmatically updating the object doesn't

Re: Just when I thought I understood bindings.

2008-10-08 Thread Chris Idou
]; Otherwise, make sure you're content object is KVC/KVO compliant etc. Tim On 9 Oct 2008, at 01:21, Chris Idou wrote: I've got an NSObjectController controlling an object. This content object's properties are bound to various fields on my screen. It seems that the bindings

Re: silly event question 'cuz i'm a n00b

2008-10-08 Thread Chris Idou
If all you actually want is a flag, why not just have a flag? When the other thread gets around to examining the flag, it can do what it wants. If you need to synchronize access to the flag, because say, the number of times they press the button is significant, then put an @synchronized

Re: Just when I thought I understood bindings.

2008-10-08 Thread Chris Idou
, Chris Idou wrote: I've got an NSObjectController controlling an object. This content object's properties are bound to various fields on my screen. It seems that the bindings are only working in one direction. Editing the fields updates the object, but programmatically updating

NSTableView and drag and drop

2008-10-10 Thread Chris Idou
I want to be able to drag strings out of a table into another field, but I must be missing something major because drags never get initiated. I've added the delegate, registered drag types and added delegate methods, but clicking and dragging within the table simply selects rows in the table,

Re: NSNull and @

2008-10-11 Thread Chris Idou
--- On Fri, 10/10/08, Ian Joyner [EMAIL PROTECTED] wrote: I'll have to think more about this. I'm not sure that KVO can't be done in a type-safe manner. I guess KVO can be done in a type safe manner, but not with the interesting way that objective-c does it. i.e. it can synthesize all the

Re: NSTableView and drag and drop

2008-10-11 Thread Chris Idou
in to the pasteboard for the NSStringPasteboardType and return YES Go through NSTableDatasource protocol. HTH, Chaitanya On 11-Oct-08, at 7:31 PM, Chris Idou wrote: I'm confused by all the examples and documentation. From what I read, the minimum required for a table to be a drag source

+(NSSet *)keyPathsForValuesAffectingValueForKey:

2008-10-13 Thread Chris Idou
Does anyone know if you can use this mechanism for dotted values, or does it have to be a value local to the object? For example, could you say that field a depends on b.c? I'm trying to do that but it doesn't seem to work or me. ___

tearing my hair out: +(NSSet *)keyPathsForValuesAffectingValueForKey:

2008-10-15 Thread Chris Idou
For one of my attributes I can't seem to get keyPathsForValuesAffectingKey to do its thing. The following is my code. I'm observing both keys to try and find out what's going on. keyPathsForValuesAffectingCanLink does get called. observeValueForKeyPath gets called for key

Re: Objective-C parameter mutation

2008-10-15 Thread Chris Idou
Works for me. -(void)aMethod:(void *)mem { NSLog(@mem2: %d, mem); } - (void)awakeFromNib { void *memory = malloc(1); NSLog(@mem1: %d, memory); [self aMethod:memory]; } 2008-10-16 11:40:36.815 aProg[30378:813] mem1: 2439440 2008-10-16 11:40:36.815

Re: tearing my hair out: +(NSSet *)keyPathsForValuesAffectingValueForKey:

2008-10-15 Thread Chris Idou
:16 PM, Chris Idou wrote: For one of my attributes I can't seem to get keyPathsForValuesAffectingKey to do its thing. The following is my code. I'm observing both keys to try and find out what's going on. keyPathsForValuesAffectingCanLink does get called. observeValueForKeyPath

Re: tearing my hair out: +(NSSet *)keyPathsForValuesAffectingValueForKey:

2008-10-15 Thread Chris Idou
: +(NSSet *)keyPathsForValuesAffectingValueForKey: To: [EMAIL PROTECTED] Cc: Cocoa Developers cocoa-dev@lists.apple.com Date: Wednesday, October 15, 2008, 5:54 PM On Oct 15, 2008, at 8:46 PM, Chris Idou wrote: I can't do that because my object inherits from NSObject, and NSObject doesn't

Re: Comparing the Class

2008-10-15 Thread Chris Idou
A category could be a nice OO solution here that avoids having the dreaded if else. --- On Wed, 10/15/08, Ken Ferry [EMAIL PROTECTED] wrote: From: Ken Ferry [EMAIL PROTECTED] Subject: Re: Comparing the Class To: Graham Cox [EMAIL PROTECTED] Cc: cocoa-dev Dev Cocoa-dev@lists.apple.com

tearing my hair, ok here is a compilable example.

2008-10-15 Thread Chris Idou
I've attached code that shows what I'm talking about with my keyPathsForValuesAffectingValueForKey problem. If anyone wants me to send a zip file (60kb) xcode project, jet let me know. For those who just want to see the code, I've appended it here also. To compile, just put the 2 classes in a

Re: tearing my hair, ok here is a compilable example.

2008-10-16 Thread Chris Idou
is a compilable example. To: cocoa-dev@lists.apple.com Date: Wednesday, October 15, 2008, 10:54 PM On Oct 15, 2008, at 22:13, Chris Idou wrote: @class Class1; @interface Class2 : NSObject { IBOutlet Class1 *class1; } @property(readonly) Class1 *class1; -(BOOL)myMethod; @end

Re: how to use the loginItem in OSX 10.3?

2008-10-16 Thread Chris Idou
Why don't you make it a regular Cocoa app that doesn't open any windows and doesn't have a dock icon? --- On Thu, 10/16/08, XiaoGang Li [EMAIL PROTECTED] wrote: From: XiaoGang Li [EMAIL PROTECTED] Subject: how to use the loginItem in OSX 10.3? To: cocoa-dev@lists.apple.com Date: Thursday,

Re: tearing my hair, Do we agree it’s a bu g?

2008-10-16 Thread Chris Idou
: tearing my hair, ok here is a compilable example. To: [EMAIL PROTECTED] Cc: cocoa-dev@lists.apple.com, Stephen J. Butler [EMAIL PROTECTED] Date: Thursday, October 16, 2008, 2:15 AM On Thu, Oct 16, 2008 at 7:54 PM, Chris Idou [EMAIL PROTECTED] wrote: I disagree. I changed both

Toolbar buttons and isEnabled binding

2008-10-21 Thread Chris Idou
I seem to be getting erratic behaviour from toolbar button isEnabled bindings. In some scenarios they don't seem to work correctly. I've tried putting the exact same binding criteria on some regular buttons just to see what happens, and they seem to work correctly when the toolbar buttons

Re: Toolbar buttons and isEnabled binding

2008-10-21 Thread Chris Idou
, October 21, 2008, 3:59 PM You can try to disable Autovalidates. On Oct 21, 2008, at 5:04 PM, Chris Idou wrote: I seem to be getting erratic behaviour from toolbar button isEnabled bindings. In some scenarios they don't seem to work correctly. I've tried putting the exact same

When does Cocoa fall apart? (Run loops)

2008-10-21 Thread Chris Idou
people noticed these situations? What causes them, and when should I look out for it? Re: Toolbar buttons and isEnabled binding From: Chris Idou [EMAIL PROTECTED] Subject: Toolbar buttons and isEnabled binding To: cocoa-dev@lists.apple.com Date: Tuesday, October 21, 2008, 7:04 AM I seem

Re: When does Cocoa fall apart? (Run loops)

2008-10-22 Thread Chris Idou
) To: [EMAIL PROTECTED] Cc: cocoa-dev@lists.apple.com Date: Wednesday, October 22, 2008, 2:42 AM in the latter, are you in a secondary thread? This could explain your problem.Otherwise, I did not experience that lately. Best, Raphael On Wed, Oct 22, 2008 at 6:05 AM, Chris Idou [EMAIL

commitEditing

2008-10-22 Thread Chris Idou
I'm calling commitEditing on a NSObjectController, and its returning NO, for no apparent or obvious reason. How am I supposed to debug these things? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

Re: commitEditing

2008-10-24 Thread Chris Idou
--- On Wed, 10/22/08, Ron Lue-Sang [EMAIL PROTECTED] wrote: The only reason a controller would return NO for commitEditing is that one of *its* editors refused to commitEditing. It's not clear to me what its editors are. All I've got is an object with some fields, with an

NSPredicateEditor - row size

2008-10-25 Thread Chris Idou
Has anyone found a way to make a row in the NSPredicateEditor to have components taller than the standard height or a more complicated arrangement of components, or are you pretty much limited to one row of buttons, and text fields and similar sized components? Programs like Hazel are able

Re: Just starting off in obj C

2008-10-26 Thread Chris Idou
, October 26, 2008, 2:24 AM On Sun, Oct 26, 2008 at 3:27 PM, Chris Idou [EMAIL PROTECTED] wrote: Which doesn't actually solve everything. For example, it would be quite a common thing in C to write a log() function that is implemented via vsprintf and family, so that you are passing format

NSPredicateEditor error

2008-10-27 Thread Chris Idou
I'm getting the following error: In NSPredicateEditor: 0x1096070, different number of items (3) than predicate template views (4) for template MyRowTemplate 0x12487e0: [move:] [] NSStringAttributeType From experimenting, the only difference between the NSPredicateEditorRowTemplate that is

Re: NSPredicateEditor error

2008-10-28 Thread Chris Idou
, October 28, 2008, 11:41 AM On Oct 27, 2008, at 10:07 PM, Chris Idou wrote: I'm getting the following error: In NSPredicateEditor: 0x1096070, different number of items (3) than predicate template views (4) for template MyRowTemplate 0x12487e0: [move:] [] NSStringAttributeType

tokenField:writeRepresentedObjects:toPasteboard:

2008-10-30 Thread Chris Idou
I was puzzled why tokenField:writeRepresentedObjects:toPasteboard: delegate function wasn't called when dragging from an NSTokenField. Then on a hunch I tried setting the delegate of the NSTokenFieldCell, and then it started getting called. Is that what I am supposed to do? Does the

NSTokenField drag and drop

2008-10-31 Thread Chris Idou
I uploaded a mini project here: http://idisk.mac.com/chris.bitmead-Public?view=web Can anyone tell me why writeRepresentedObjects isn't called on the TokenDelegate when you drag a token from one field to the other? ___ Cocoa-dev mailing

Localization...

2008-11-02 Thread Chris Idou
I don't seem to be having much luck getting localization to work. I've got a utf16 strings file in my project called MetaData.strings that contains: kMDItemFSLabel = color label; Then in my code... [[NSBundle bundleForClass:[self class]] localizedStringForKey:@kMDItemFSLabel value:@nothing

Re: Porting from Windows to Mac

2008-11-02 Thread Chris Idou
Do you really mean this? As far as I've heard, Apple's official stance has never been to classify Carbon as a legacy technology (though they've certainly taken all the steps). Can we finally settle this issue and start calling things as they are? Of course there is the whole issue of

NSPredicateEditor

2008-11-02 Thread Chris Idou
Has anyone been able to add menu items to the first popup while it is running? Or are you pretty much stuck with whatever the initial values were? I've tried various things and haven't been able to do it. ___ Cocoa-dev mailing list

Triggering NSTextView changes and bindings

2009-02-01 Thread Chris Idou
I've got an NSTextView whose attributeValue is bound to a core-data object. I've got a menu item which programmatically modifies the NSTextView's contents. The programmatic changes don't trigger a modification to the underlying object unless the user tabs to and exits the NSTextView manually.

Auto-saving documents

2009-02-01 Thread Chris Idou
I want my app to automatically save a document when the user closes its window, without prompting the user. I had thought I'd found a solution by overriding - (void)canCloseDocumentWithDelegate:(id)delegate shouldCloseSelector:(SEL)shouldCloseSelector contextInfo:(void*)contextInfo to call

Re: Auto-saving documents

2009-02-01 Thread Chris Idou
On Sun, Feb 1, 2009 at 6:52 PM, Chris Idou idou...@yahoo.com wrote: I want my app to automatically save a document when the user closes its window, without prompting the user. What do you want to do if the user hasn't saved the document? Do you want to prompt the user, save to a default

Advanced NSTextView use

2009-02-03 Thread Chris Idou
I'm trying to use NSTextView so that it has tokens in the text (kind of like NSTokenField). So I want it that if you try and delete any character that is part of a token, it deletes the entire token. So I'm overriding rangeForUserTextChange to return a different range if the current range

Re: Advanced NSTextView use

2009-02-04 Thread Chris Idou
are not inside the range yet as far as the existing range, and you can't predict in advance the user intends to backspace into it, and for the same reason, neither is the rangeForUserTextChange. On Feb 3, 2009, at 5:24 PM, Chris Idou wrote: So I want it that if you try and delete any character

FSExchangeObjects / FSReplaceObject

2009-02-09 Thread Chris Idou
As I understand it, we are supposed to use FSReplaceObject because FSExchangeObjects does not properly retain all meta-data. But it seems like FSReplaceObject is not actually documented. Sure it is mentioned here and there in release notes and so forth, but there is no actual proper API

Re: Network communications help

2009-02-10 Thread Chris Idou
From what you are saying, I would get the classic intro to UNIX network programming and read the part on sockets: http://www.amazon.com/UNIX-Network-Programming-Richard-Stevens/dp/0139498761 From: gumbo...@mac.com gumbo...@mac.com To: Cocoa-Dev List

RTFD - HTML ( NSHTMLTextDocumentType )

2009-02-15 Thread Chris Idou
When converting an AttributedString to HTML per http://www.cocoadev.com/index.pl?HTMLFromRTFD all the links begin with file:///. So trying to open the result in a browser results in broken links for all the images since apparently file:/// signifies the root directory. Why aren't the links

Re: At what point during loading can NSPersistentDocument fetch?

2009-02-16 Thread Chris Idou
readFromURL is the appropriate place to start populating the document. From: Jerry Krinock je...@ieee.org To: Cocoa Developers cocoa-dev@lists.apple.com Sent: Tuesday, 17 February, 2009 12:49:44 PM Subject: At what point during loading can

FOLDERS and document based apps (Open Recent)

2009-02-18 Thread Chris Idou
If I add public.folder to my Info.plist as a valid type of document my app can open, some things don't work. Open Document doesn't work, albeit its not too hard to get around by subclassing NSDocumentController and redefining the openDocument: However Open Recent is more tricky because as

Re: Adding Multiple NSWindow or NSPanel into another NSWindow

2009-02-18 Thread Chris Idou
You can have an MDI interface on the Mac, but you have to do all the hard work yourself, because there is no MDI widgets provided. One alternative is a tabbed interface. There is some free code somewhere that does a Safari-like tabbed interface. Make Yahoo!7 your homepage and win a

Getting the front process path

2009-03-12 Thread Chris Idou
I thought I'd figured out how to get the path of the currently running process: GetFrontProcess, then CopyProcessName, and then [[NSWorkspacesharedWorkspace] fullPathForApplication:app] This works most of the time, but some programs, for example Aquamacs Emacs, has just Aquamacs in the

Enforcing trial software on Mac

2009-03-16 Thread Chris Idou
Is there any accepted, or preferred or standard way of enforcing a trial software period for a program on Mac, so that people can't just delete their preferences or something and start the trial again? Or does every developer hack their own little solution? (i.e. write a file to an obscure

Re: NSLog fixes output, but why?

2009-03-18 Thread Chris Idou
Should we assume you have eliminated the obvious, that the arguments to NSLog don't have any method calls with side effects? Or are there multiple threads whose timing could be changed by the logging? From: James Maxwell jbmaxw...@rubato-music.com To: Cocoa

EXC_BAD_ACCESS and NSAttributedString driving me crazy

2009-03-30 Thread Chris Idou
I'm getting NSRTFDPboardType and NSRTFPboardType objects as NSData from the pasteboard and I'm storing them in a core data XML repository and getting them out again, and when necessary I'm converting them into NSAttributedString with initWithRTF or initWithRTFD. This mostly works but every now

Re: EXC_BAD_ACCESS and NSAttributedString driving me crazy

2009-03-30 Thread Chris Idou
to the conclusion of blaming Apple, if it wasn't that this API must be a very widely called one. From: Sean McBride cwat...@cam.org To: Chris Idou idou...@yahoo.com; cocoa-dev@lists.apple.com Sent: Tuesday, 31 March, 2009 2:43:18 PM Subject: Re: EXC_BAD_ACCESS

Re: EXC_BAD_ACCESS and NSAttributedString driving me crazy

2009-03-30 Thread Chris Idou
, the crashes stop happening. I'm relieved to know I at least have a workaround. Does this tend to indicate some kind of Apple GC bug? From: Ali Ozer ao...@apple.com To: Chris Idou idou...@yahoo.com Cc: Cocoa Dev cocoa-dev@lists.apple.com Sent: Tuesday, 31 March

MDItemCopyAttribute and kMDItemFinderComment

2009-04-21 Thread Chris Idou
I've got a program which uses MDItemCopyAttribute to get the kMDItemFinderComment, and I was playing around testing it, by changing the value in the Finder and seeing if the value changed in my program, and they ended up out of synch. It ends up that mdls returns a different value than xattr

Re: MDItemCopyAttribute and kMDItemFinderComment

2009-04-21 Thread Chris Idou
Comments and spotlight seems instantaneous, but then on this occasion they seemed to refuse to sync. On Apr 21, 2009, at 8:04 AM, Chris Idou wrote: I've got a program which uses MDItemCopyAttribute to get the kMDItemFinderComment, and I was playing around testing

Vector Graphic Dock Icon?

2009-05-06 Thread Chris Idou
Is it possible to use a vector graphic as a dock icon? The Apple doco seems to encourage using vector graphics, but I can't find it documented what format it would expect. I tried a PDF but that didn't seem to work. Enjoy a better web experience. Upgrade to the new Internet Explorer 8

Re: Vector Graphic Dock Icon?

2009-05-06 Thread Chris Idou
). From: Shawn Erickson shaw...@gmail.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Thursday, 7 May, 2009 3:00:18 AM Subject: Re: Vector Graphic Dock Icon? On Wed, May 6, 2009 at 7:44 AM, Chris Idou idou...@yahoo.com wrote: Is it possible to use a vector graphic

Garbage collector related crash

2009-05-08 Thread Chris Idou
I've got an object that holds onto a CF ref: mdref= MDItemCreate(nil, (CFStringRef)path); [NSMakeCollectable(mdref) autorelease]; I think I'm doing the right thing in the class declaration: @interface MetadataItem : NSObject { __strongMDItemRefmdref; @end But every now and then:

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 b...@mac.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Saturday, 9 May

Testing 32/64 bit and/or PPC

2009-08-28 Thread Chris Idou
If you have a universal binary, 32/64 and/or PPC, is there a way to force it to run one way or the other for testing purposes? __ Find local businesses and services in your area with Yahoo!7 Local. Get

testing ppc on intel

2009-09-13 Thread Chris Idou
Every program that I build universal but run on intel (OS 10.5) with arch -ppc option, crashes with a report like the following, and I've tested quite a few, even simple ones. Is it unreasonable to try to test ppc programs on intel, or am I doing something wrong, or what? Version:

  1   2   3   >