Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Rick Mann
I'd like to use a CALayer object as a key in a dictionary. The reason is that when my app detects a hit in a layer, I need to quickly determine which object I've associated with it. Since I can't store a reference to an arbitrary object in the CALayer, a dictionary seems to be the most

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Roland King
Because NSDictionary requires keys to be copyable because it copies them (it's in the documentation). Use a CFDictionary() instead, you can set it up to retain the keys and do what you want. Rick Mann wrote: I'd like to use a CALayer object as a key in a dictionary. The reason is that when

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Rick Mann
On Feb 1, 2010, at 00:10:11, Roland King wrote: Because NSDictionary requires keys to be copyable because it copies them (it's in the documentation). Use a CFDictionary() instead, you can set it up to retain the keys and do what you want. Oh! I thought NSDictionary and CFDictionary were

Re: NSDocument save as bug

2010-02-01 Thread Half Activist
Not at all! The bug comes from the fact that it is called twice, first when the document's nib is loaded (and everything is ok) and secondly when the panel opens in which case yes it crashes becaus e initialization already took place and it shouldn't be called however. regards. On Feb 1,

Re: Crash in NSControl's sizeToFit

2010-02-01 Thread slasktrattena...@gmail.com
On Mon, Feb 1, 2010 at 6:55 AM, Jens Alfke j...@mooseyard.com wrote: On Jan 31, 2010, at 7:39 AM, slasktrattena...@gmail.com wrote: This looks like a bug in AppKit but I'm not sure. Any ideas? (I cannot reproduce the problem.) No, it's a bug in 'myProject' — it's calling AppKit from a

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Roland King
Tollfree Bridging is a little more complicated than that. They may end up being the same object under the covers, but even if they are, the NSDictionary version doesn't come with the range of options that the CFDictionary does. Just make a CFDictionary(), the default for it is to retain keys

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Rick Mann
I tried doing this: const void* retainCallback(CFAllocatorRef inAlloc, const void* inValue) { NSObject* val = (NSObject*) inValue; [val retain]; return val; } void releaseCallback(CFAllocatorRef inAlloc, const void* inValue) { NSObject* val = (NSObject*) inValue;

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Jean-Daniel Dupas
Don't bother with custom callback, CFType one works with any objects. Le 1 févr. 2010 à 09:32, Rick Mann a écrit : I tried doing this: const void* retainCallback(CFAllocatorRef inAlloc, const void* inValue) { NSObject* val = (NSObject*) inValue; [val retain]; return

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Rick Mann
On Feb 1, 2010, at 00:40:28, Jean-Daniel Dupas wrote: Don't bother with custom callback, CFType one works with any objects. Well, that was the one I tried first, but it failed with the same error. Le 1 févr. 2010 à 09:32, Rick Mann a écrit : I tried doing this: const void*

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Roland King
As I said in my earlier mail, if I set up a CFDictionary() which is not copy for keys and retain for values, then I don't use tollfree bridging and use the NSMutableDictionary mutators because they don't work. (in my experience) I use CFDictionaryAddValue() instead. When checking for keys or

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Rick Mann
Oh I see. Have to use pure CFDictionary. Well, it's all moot, since I can just story the object with the CALayer. Thanks for that! -- Rick On Feb 1, 2010, at 00:49:23, Roland King wrote: As I said in my earlier mail, if I set up a CFDictionary() which is not copy for keys and retain for

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Dave Keck
Alternatively you could wrap the CALayer in an NSValue: [NSValue valueWithNonretainedObject:]. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Rick Mann
On Feb 1, 2010, at 01:38:17, Dave Keck wrote: Alternatively you could wrap the CALayer in an NSValue: [NSValue valueWithNonretainedObject:]. Ah, something else to keep in mind. Thanks! -- Rick ___ Cocoa-dev mailing list

NSDocument override Undo's default handling of changes count

2010-02-01 Thread Ernesto Giannotta
Hello list, I'm using NSDocument default undoManager but want to override it's change counting behaviour (I want the black modifed dot to not show when some minor changes are done, but still have them undoable) I've discovered it's internally handled by these methods observing the

Re: NSDocument override Undo's default handling of changes count

2010-02-01 Thread Graham Cox
On 01/02/2010, at 9:27 PM, Ernesto Giannotta wrote: Hello list, I'm using NSDocument default undoManager but want to override it's change counting behaviour (I want the black modifed dot to not show when some minor changes are done, but still have them undoable) I've discovered it's

Sending messages without knowing number of args and types at compile time

2010-02-01 Thread Per Bull Holmen
Hi I've been playing around with the idea of making a simple bridge between Objective-C (running under Cocoa) and a script language. Not for the API, that is, but for user defined classes and methods. For this reason, I'd like to know whether there are any other ways than NSInvocation to send

Re: bind:toObject:withKeyPath:options: Unidirectional or Bidirectional?

2010-02-01 Thread Quincey Morris
On Jan 31, 2010, at 19:03, Matt Neuburg wrote: There's a common misconception here, and I see a lot of nonsense written about it, to which I with difficulty restrain myself from responding. It's all very simple. (1) There is no such thing as a bidirectional binding; all bindings are

Re: convert password from SecKeychainFindGenericPassword to NSString

2010-02-01 Thread Stuart Malin
On Jan 31, 2010, at 9:53 PM, Jens Alfke wrote: No. You don't want to pass a null terminated string to anything but the methods that explicitly take a C string. Anything else just wants the characters, with no nulls. --Jens {via iPhone} NSString's +stringWithCString:encoding: does

Re: convert password from SecKeychainFindGenericPassword to NSString

2010-02-01 Thread Stuart Malin
On Jan 31, 2010, at 9:49 PM, Kyle Sluder wrote: On Sun, Jan 31, 2010 at 6:28 PM, Stuart Malin stu...@zhameesha.com wrote: If I use +dataWithBytes:length: then I need to specify a length 1 greater, and that additional byte must be set to 0 (to null terminate the string). So, I could use

Tutorial for writing a bindings-compliant NSView subclass?

2010-02-01 Thread Alexander Heinz
Hello fellow Cocoa-devs, Does anyone know where to find a good tutorial or more information about writing a bindings-compatible subclass of NSView? I've seen Apple's example code on the subject, but it looks like it's a lot more complicated than it should be. I don't need Interface Builder

Weird Parsed HTML string into NSXMLDocument

2010-02-01 Thread Gustavo Pizano
Hello all: I have a string with the html I created, i the following: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; head meta http-equiv=Content-Type content=text/html; charset=UTF-8

__weak references in non-GC

2010-02-01 Thread Roland King
I read the following passage (reproduced verbatim) in a book .. Weak references were added in Mac OS X Leopard and effectively zero out the reference if the referenced object is released. This is primarily used when the garbage collector is turned on, but it is a helpful flag to use when doing

Re: NSDocument save as bug

2010-02-01 Thread Gregory Weston
Half Activist wrote: On Feb 1, 2010, at 8:54 AM, Alexey Zakhlestin wrote: On 01.02.2010, at 10:13, Half Activist wrote: Hello, In a NSDocument based application, my document class handles 3 different kinds of documents, 1 as a viewer and 2 as an editor. Actually, I wished it

[iPhone] Implementing APN , push notification not received to iphone

2010-02-01 Thread Tharindu Madushanka
I have followed the following steps properly. And I used PushMeBaby application as the server to test push notifications since I not having much experience in implementing server side code my self for push notification. Using my adHoc Distribution profile.. PushMeBaby source code -

Re: updating NSView on separate thread

2010-02-01 Thread Kyle Sluder
You're going at it backwards. Do your UI work on the main thread, and run your importer on the background thread. Or better yet use Grand Central Dispatch. --Kyle Sluder On Jan 31, 2010, at 8:02 PM, Patrick Cusack livinginlosange...@mac.com wrote: As I understand then, all drawRect

Re: updating NSView on separate thread

2010-02-01 Thread Kyle Sluder
Ooh. So you need to perform this operation synchronously but still pole the main thread (performing UI work is actually irrelevant; you need to run the runloop to avoid the spinning beachball anyway). So in your override of -writeToURL:…, spin off the background thread like I suggested,

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Charles Jenkins
On 2010-02-01 03:26, Roland King wrote: By the way, CALayer is a KVC compliant class so you can in fact just store a reference to an arbitrary object in it with [ layer setValue:value forKey:@KeyForObjectAssociatedWithLayer ]; Roland, I'm a noob and I'm not sure I've got a good handle on

Re: NSDocument override Undo's default handling of changes count

2010-02-01 Thread Jeffrey Oleander
On Mon, 2010/02/01, Ernesto Giannotta e...@apimac.com wrote: From: Ernesto Giannotta e...@apimac.com Subject: NSDocument override Undo's default handling of changes count To: Cocoa List cocoa-dev@lists.apple.com Date: Monday, 2010 February 1, 04:27 I'm using NSDocument default undoManager

Re: __weak references in non-GC

2010-02-01 Thread Joar Wingfors
On 1 feb 2010, at 06.08, Roland King wrote: I understand that __weak references are zeroing in GC code but in memory managed code I didn't think they did anything at all. Is the text I quoted incorrect? Yes, __weak doesn't do anything for RC. j o a r

Re: updating NSView on separate thread

2010-02-01 Thread Scott Ribe
Do you really really have to lock the UI? Are you sure? -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Alexander Spohr
Am 01.02.2010 um 16:35 schrieb Charles Jenkins: On 2010-02-01 03:26, Roland King wrote: By the way, CALayer is a KVC compliant class so you can in fact just store a reference to an arbitrary object in it with [ layer setValue:value forKey:@KeyForObjectAssociatedWithLayer ]; Roland,

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Roland King
yes I just picked a totally random key name tied to the question the original poster was asking, it was supposed to be illustrative (he wanted to associate an object with the layer so I picked a name to attempt to show that). No sorry in general it doesn't work that way, it's possible,

Re: Crash in NSControl's sizeToFit

2010-02-01 Thread slasktrattena...@gmail.com
Quick followup: is it safe to set the token field's object value from the background thread, or do I need to do it on the main thread as well? Or to put it in more general terms: are _all_ calls to AppKit from a background thread disallowed, or only those regarding updating the UI? Also, is it

Re: Weird Parsed HTML string into NSXMLDocument

2010-02-01 Thread Gustavo Pizano
[SOVED] Hello, sometimes I curse myself for not trying harder before posting. I just initialized the xmlDoc with options NSXMLPreserveCDATA and NSXMLDCocument TidHML.. then I was accessing nodes from the rootNode, and I could see in debug all. Gustavo On Feb 1, 2010, at 3:01 PM, Gustavo

Re: Crash in NSControl's sizeToFit

2010-02-01 Thread Joar Wingfors
You're not allowed to do *anything* on non-main threads unless the documentation *explicitly* says that it's OK. You should approach this subject with great caution and restraint. If you can't prove that something is safe, assume that it's not, and stay away from it. j o a r On 1 feb 2010,

Re: Tutorial for writing a bindings-compliant NSView subclass?

2010-02-01 Thread Matt Neuburg
On Mon, 1 Feb 2010 08:43:27 -0500, Alexander Heinz ahei...@johnshopkins.edu said: Hello fellow Cocoa-devs, Does anyone know where to find a good tutorial or more information about writing a bindings-compatible subclass of NSView? Did you even *try* google? Searching on bindings tutorial nsview

Re: __weak references in non-GC

2010-02-01 Thread Corbin Dunn
On Feb 1, 2010, at 6:08 AM, Roland King wrote: I read the following passage (reproduced verbatim) in a book .. Weak references were added in Mac OS X Leopard and effectively zero out the reference if the referenced object is released. This is primarily used when the garbage collector is

Re: Sending messages without knowing number of args and types at compile time

2010-02-01 Thread Jens Alfke
On Feb 1, 2010, at 3:30 AM, Per Bull Holmen wrote: I've been playing around with the idea of making a simple bridge between Objective-C (running under Cocoa) and a script language. Not for the API, that is, but for user defined classes and methods. For this reason, I'd like to know

Re: Crash in NSControl's sizeToFit

2010-02-01 Thread Kyle Sluder
On Mon, Feb 1, 2010 at 8:16 AM, slasktrattena...@gmail.com slasktrattena...@gmail.com wrote: Quick followup: is it safe to set the token field's object value from the background thread, or do I need to do it on the main thread as well? Or to put it in more general terms: are _all_ calls to

Re: convert password from SecKeychainFindGenericPassword to NSString

2010-02-01 Thread Jens Alfke
On Feb 1, 2010, at 3:58 AM, Stuart Malin wrote: My code worked fine with NSString's +stringWithCString:length: even though the string was not NULL terminated. Ah, you're right, I'd forgotten that method. It doesn't look for a NUL terminator because the length is given explicitly. You

Re: updating NSView on separate thread

2010-02-01 Thread Jens Alfke
On Feb 1, 2010, at 7:20 AM, Kyle Sluder wrote: So in your override of -writeToURL:…, spin off the background thread like I suggested, then set up your UI, and then start running the runloop in a special modal mode until your background thread is done. Nested runloops like this are usually

Re: Tutorial for writing a bindings-compliant NSView subclass?

2010-02-01 Thread Kyle Sluder
On Mon, Feb 1, 2010 at 8:38 AM, Matt Neuburg m...@tidbits.com wrote: Did you even *try* google? Searching on bindings tutorial nsview subclass led almost directly to this. The OP explained that he was confused by the sample code. --Kyle Sluder ___

[JOB] New York City Cocoa developer

2010-02-01 Thread Lee Gillen
Hello, I am forwarding a job request I was sent recently. It's from a technical recruiter, Bob Wallace. Please contact him for any information in regards to this job request. Regards, Lee - Job Description We are looking for a talented individual to take over the future development and

Re: NSDocument save as bug

2010-02-01 Thread Half Activist
I'm not making any assumption on the number of documents that might exist at one time. Even if i have 10 documents opened, the one that i do a save as on has its _instance method_ awakeFromNib called a second time: The callstack shows that my document's awakeFromNib is being called during the

Re: NSDocument save as bug

2010-02-01 Thread Kyle Sluder
On Mon, Feb 1, 2010 at 9:16 AM, Half Activist halfactiv...@gmail.com wrote: Even if i have 10 documents opened, the one that i do a save as on has its _instance method_ awakeFromNib called a second time: Are you sure it's the same instance? It really looks like you have accidentally added an

Re: Crash in NSControl's sizeToFit

2010-02-01 Thread slasktrattena...@gmail.com
On Mon, Feb 1, 2010 at 5:28 PM, Joar Wingfors j...@joar.com wrote: You're not allowed to do *anything* on non-main threads unless the documentation *explicitly* says that it's OK. You should approach this subject with great caution and restraint. If you can't prove that something is safe,

Re: updating NSView on separate thread

2010-02-01 Thread Corbin Dunn
On Feb 1, 2010, at 8:57 AM, Jens Alfke wrote: On Feb 1, 2010, at 7:20 AM, Kyle Sluder wrote: So in your override of -writeToURL:…, spin off the background thread like I suggested, then set up your UI, and then start running the runloop in a special modal mode until your background

Re: Displaying animated content in iPhone app

2010-02-01 Thread David Duncan
On Jan 30, 2010, at 5:11 AM, patrick machielse wrote: I've given animationImages a try, and although performance is good I run into memory warnings when the array contains about 30 full screen images (1 Sec. worth). I've tried to implement my own NSView subclass -- managing memory for

Re: How to upload a picture or movie existed in the iphone to a given server?

2010-02-01 Thread Nick Zitzmann
On Feb 1, 2010, at 12:26 AM, James wrote: So, I expect someone give me some directions. Don't expect anything from this list, because we're all volunteers. for example, which protocol should I use? What protocol does the server use? If it uses WebDAV, then you should use HTTP PUT. If it

Re: Tutorial for writing a bindings-compliant NSView subclass?

2010-02-01 Thread Alexander Heinz
On Feb 1, 2010, at 11:38 AM, Matt Neuburg wrote: On Mon, 1 Feb 2010 08:43:27 -0500, Alexander Heinz ahei...@johnshopkins.edu said: Hello fellow Cocoa-devs, Does anyone know where to find a good tutorial or more information about writing a bindings-compatible subclass of NSView? Did you

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Michael Ash
On Mon, Feb 1, 2010 at 3:05 AM, Rick Mann rm...@latencyzero.com wrote: I'd like to use a CALayer object as a key in a dictionary. The reason is that when my app detects a hit in a layer, I need to quickly determine which object I've associated with it. Since I can't store a reference to an

Re: Returning a nil float?

2010-02-01 Thread Michael Gardner
On Jan 29, 2010, at 6:44 PM, Chunk 1978 wrote: i'm almost 100% sure it's not possible to return a nil on basic data types, but just incase i'll post the question. -- - (float)panForSoundWithName:(NSString *)soundName {

Re: updating NSView on separate thread

2010-02-01 Thread Michael Ash
On Mon, Feb 1, 2010 at 10:20 AM, Kyle Sluder kyle.slu...@gmail.com wrote: Ooh. So you need to perform this operation synchronously but still pole the main thread (performing UI work is actually irrelevant; you need to run the runloop to avoid the spinning beachball anyway). So in your

Core Data - Add an Entity to another Entity How?

2010-02-01 Thread Andreas Grauel
a Person or Game to an Event. How can i manage this? http://idisk.me.com/andreasgrauel/Public/Pictures/Skitch/Kegeln-20100201-184547.png there you see my interface. I would like to add a person(Spieler)/game(Spiel) to the event with the + Button but how? I have the autogenerated accessor Methods

Re: NSDocument save as bug

2010-02-01 Thread Gregory Weston
On Feb 1, 2010, at 12:16 PM, Half Activist wrote: I'm not making any assumption on the number of documents that might exist at one time. Even if i have 10 documents opened, the one that i do a save as on has its _instance method_ awakeFromNib called a second time: The callstack shows that

Re: Returning a nil float?

2010-02-01 Thread Jean-Daniel Dupas
Le 1 févr. 2010 à 19:17, Michael Gardner a écrit : On Jan 29, 2010, at 6:44 PM, Chunk 1978 wrote: i'm almost 100% sure it's not possible to return a nil on basic data types, but just incase i'll post the question. -- -

Re: Sending messages without knowing number of args and types at compile time

2010-02-01 Thread Michael Ash
On Mon, Feb 1, 2010 at 6:30 AM, Per Bull Holmen pbhol...@yahoo.com wrote: Hi I've been playing around with the idea of making a simple bridge between Objective-C (running under Cocoa) and a script language. Not for the API, that is, but for user defined classes and methods. For this reason,

Re: Sending messages without knowing number of args and types at compile time

2010-02-01 Thread Greg Parker
On Feb 1, 2010, at 3:30 AM, Per Bull Holmen wrote: I've been playing around with the idea of making a simple bridge between Objective-C (running under Cocoa) and a script language. Not for the API, that is, but for user defined classes and methods. For this reason, I'd like to know whether

Re: updating NSView on separate thread

2010-02-01 Thread Patrick Cusack
So, let me clarify further: Someone asked why a save operation would take a few seconds. I can answer that I have an object model that is stored in ram and then serialized to disk. I should have started the data model as a Coredata project, but decided not to since my datasets would never be

Re: Why can't I use any object as a key in a dictionary?

2010-02-01 Thread Rick Mann
On Feb 1, 2010, at 08:00:45, Alexander Spohr wrote: This is a wrong assumption. Most classes are KVC compliant but you can not invent keys. You just use existing keys - properties and methods. Ah! That's the key piece of information. Now I feel better that I didn't totally misunderstand

Re: updating NSView on separate thread

2010-02-01 Thread Jens Alfke
On Feb 1, 2010, at 12:11 PM, Patrick Cusack wrote: As for NSRunLoop, let me see if I understand. I have created a new Thread with [NSThread detachNewThreadSelector:toTarget:withObject:]. The selector is a do loop that periodically calls a custom NSView's redisplay method that invokes

dynamic changing of ability to set multiple selections...

2010-02-01 Thread Matthew Weinstein
Dear cocoa-ites, I have multiple linked NSTableViews in an app. Depending on which one is clicked in the others change their contents. Now normally if someone clicks on table 1 they should not be allowed to have multiple selections; but if they click in table 2, the application needs to be

Showing a menu after a delay...?

2010-02-01 Thread Eric Gorr
What I am trying to accomplish is displaying a menu (perhaps with NSPopUpButtonCell's performClickWithFrame method) after a user clicks on a sublass of NSButton and holds the left mouse button for = 1 second. Is anyone aware of any sample code doing this? I imagine I will need to customize the

Re: Showing a menu after a delay...?

2010-02-01 Thread Richard Penwell
An alternative technique would be roughly: 1. Detect mouse down, set state down 2. Call performSelectorAfterDelay 1 second with a test method 3. If the mouse goes up, set state up 4. In the test method, test if the state is down... On Feb 1, 2010, at 4:42 PM, Eric Gorr wrote: What I am trying

Re: Showing a menu after a delay...?

2010-02-01 Thread Gustavo Pizano
Eric Hi, What Richar said its what Im actually doing to achieve such a behaviour, using the performSelectorAfterDelay, will be your best shot but what I do is that if the mouse goes up you just call the the NSObject method cancelPreviousPerformRequestsWithTarget. then the selector will not be

Re: Showing a menu after a delay...?

2010-02-01 Thread Eric Gorr
Sadly, that does not work. performSelector:withObject:afterDelay: will only perform the selector after a delay after the mouse button goes up. I had actually tried doing this manually with the code NSTimer *mouseStillDownTimer = [NSTimer timerWithTimeInterval:1 target:self

Re: Showing a menu after a delay...?

2010-02-01 Thread Eric Gorr
Strange, I just replied to Richard saying that my selector is not performed until after the mouse button goes up. I can hold the mouse button down for several seconds and not see the selector performed. Of course, this may actually be due to the fact that my core event loop is based around

Re: Showing a menu after a delay...?

2010-02-01 Thread Richard Penwell
Might try pausing execution after the mouse down to see what's preventing the run loop from pumping. PerformSelector... puts an event on the run loop, so it must not be getting to future events. When you let your finger off the mouse, the selector is performed with no delay correct? On Feb

Re: Showing a menu after a delay...?

2010-02-01 Thread Eric Gorr
I am actually not sure how to pause the execution while holding the mouse button down. It appears there is a delay...the delay I specified in performSelector:withObject:afterDelay: ... however, the selector is always performed. On Feb 1, 2010, at 5:15 PM, Richard Penwell wrote: Might try

Re: Showing a menu after a delay...?

2010-02-01 Thread Peter Ammon
Hi Eric, Consider using a single-segment NSSegmentedControl. If the NSSegmentedControl has both an action and a menu, then you will get the behavior you describe. Furthermore, it will use the system-standard menu delay, plus make the menu available to accessibility clients. -Peter On Feb

Re: Showing a menu after a delay...?

2010-02-01 Thread Henry McGilton (Boulevardier)
On Feb 1, 2010, at 2:11 PM, Eric Gorr wrote: Strange, I just replied to Richard saying that my selector is not performed until after the mouse button goes up. I can hold the mouse button down for several seconds and not see the selector performed. Of course, this may actually be due to

Re: Showing a menu after a delay...?

2010-02-01 Thread Eric Gorr
I like this. I shall have to play around with it a bit. Although, I don't think it will have other features I need from NSButton like setShowsBorderOnlyWhileMouseInside. But, I could probably have my subclass implement that, which may be easier then getting the NSButton to show a menu

NSView -reshape method

2010-02-01 Thread Ariel Feinerman
Hi, is there NSView method, maybe delegate, that is called only when a view is changed size, like -reshape NSOpenGLView? -- best regards Ariel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: NSView -reshape method

2010-02-01 Thread Kyle Sluder
On Mon, Feb 1, 2010 at 2:49 PM, Ariel Feinerman arielfap...@gmail.com wrote: is there NSView method, maybe delegate, that is called only when a view is changed size, like -reshape NSOpenGLView? Read up on NSViewFrameDidChangeNotification. --Kyle Sluder

Re: NSView -reshape method

2010-02-01 Thread Graham Cox
On 02/02/2010, at 9:49 AM, Ariel Feinerman wrote: is there NSView method, maybe delegate, that is called only when a view is changed size -setFrame: --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: NSView -reshape method

2010-02-01 Thread Ariel Feinerman
Graham, my implementation - (void) setFrame: (NSRect) frame { [super setFrame: frame]; // set sizes } 2010/2/2 Graham Cox graham@bigpond.com On 02/02/2010, at 9:49 AM, Ariel Feinerman wrote: is there NSView method, maybe delegate, that is called only when a view is changed

Re: Showing a menu after a delay...?

2010-02-01 Thread Nathan Kinsinger
On Feb 1, 2010, at 2:42 PM, Eric Gorr wrote: What I am trying to accomplish is displaying a menu (perhaps with NSPopUpButtonCell's performClickWithFrame method) after a user clicks on a sublass of NSButton and holds the left mouse button for = 1 second. Is anyone aware of any sample code

Re: Showing a menu after a delay...?

2010-02-01 Thread Eric Gorr
Very cool. Thank you! I shall have to bookmark that page. On Feb 1, 2010, at 6:18 PM, Nathan Kinsinger wrote: On Feb 1, 2010, at 2:42 PM, Eric Gorr wrote: What I am trying to accomplish is displaying a menu (perhaps with NSPopUpButtonCell's performClickWithFrame method) after a user

Re: NSTableView Column Header Restrictions?

2010-02-01 Thread Daniel Wambold
OK, first, thanks to Quincey for pointing out the document on KVO/KVB key requirements. Since I've made several mistakes along the way, I figured I'd ask if this seems adequate to ensure conversion of arbitrary strings (keyboard entered) into compliant keys. The code subsequently checks to

Re: Showing a menu after a delay...?

2010-02-01 Thread Scott Anguish
the selector is always performed because you don’t cancel it when the mouse is let up in 1 second. that’s the missing part. you need to remove the call. check almost any iPhone touch stuff that does double taps for an example. On Feb 1, 2010, at 5:19 PM, Eric Gorr wrote: I am actually not

Re: Showing a menu after a delay...?

2010-02-01 Thread Eric Schlegel
On Feb 1, 2010, at 2:08 PM, Eric Gorr wrote: performSelector:withObject:afterDelay: will only perform the selector after a delay after the mouse button goes up. I had actually tried doing this manually with the code NSTimer *mouseStillDownTimer = [NSTimer timerWithTimeInterval:1

Re: NSDocument save as bug

2010-02-01 Thread Half Activist
Hi Kyle, the problem is my save panel doesn't have an accessory view :S Regards. On Feb 1, 2010, at 6:28 PM, Kyle Sluder wrote: On Mon, Feb 1, 2010 at 9:16 AM, Half Activist halfactiv...@gmail.com wrote: Even if i have 10 documents opened, the one that i do a save as on has its

Binding to an accessor that is only valid for subclass (was: Node hierarchy with subclasses)

2010-02-01 Thread BareFeet
On Jan 29, 2010, at 9:38 AM, Jerry Krinock wrote: The problem is that when a subclass A is selected, the UI elements bound to subclass B no longer have valid bindings so generate an error. How can I solve this? You can also uncheck the Raises For Not Applicable Keys in the bindings

Re: NSDocument save as bug

2010-02-01 Thread Half Activist
Hi Gregory, thanks for your support, I was a bit upset because I'm pretty sure the same instance fails. Because when the crashes began to happen after adding the second document type, I put a breakpoint in awakeFromNib, and by giving a look at the document, I knew that this was a

Re: Returning a nil float?

2010-02-01 Thread Michael Gardner
On Feb 1, 2010, at 12:58 PM, Jean-Daniel Dupas wrote: Le 1 févr. 2010 à 19:17, Michael Gardner a écrit : On Jan 29, 2010, at 6:44 PM, Chunk 1978 wrote: i'm almost 100% sure it's not possible to return a nil on basic data types, but just incase i'll post the question.