Re: super respondsToSelector

2008-05-30 Thread Ken Thomases
On May 31, 2008, at 1:22 AM, Russ McBride wrote: Anyone want to take a stab at explaining to me as thoroughly as possible why [super respondsToSelector: aSelector] doesn't actually do what it looks like it should do? Bonus points if you can explain why I can override the respondsT

Re: super respondsToSelector

2008-05-30 Thread Bill Bumgarner
On May 30, 2008, at 11:43 PM, Jens Alfke wrote: If you actually want to ask a question of your class's superclass, you have to do so directly: [[[self class] superclass] instancesRespondToSelector: aSelector] Well... yeah... you *can* do that. But *don't do that*. (And I know Jens

Re: RESTful API's - Easy way to interact?

2008-05-30 Thread Jens Alfke
On 30 May '08, at 7:16 PM, Jeremy wrote: Now, I need to figure out how to use set GET, but I think that is working. The problem and it is crashing is because it is being encoded by every other method. What? That sentence was incomprehensible. Apologies if you're not a native English spea

Re: How can i get current system time?

2008-05-30 Thread j o a r
On May 30, 2008, at 11:40 PM, haresh vavdiya wrote: I have read about NSDate, NSTimer but i can't understand how to use that class for getting current system time? You could use +[NSDate date], as it according to the documentation: "Creates and returns a new date set to the current

Re: How can i get current system time?

2008-05-30 Thread Andrew Farmer
On 30 May 08, at 23:40, haresh vavdiya wrote: Thank for giving me answer. I want to do one small clock for my iPhone but i can't understand how can i get current system time? I have read about NSDate, NSTimer but i can't understand how to use that class for gett

Re: How can i get current system time?

2008-05-30 Thread Jens Alfke
On 30 May '08, at 11:40 PM, haresh vavdiya wrote: I want to do one small clock for my ** but i can't understand If you keep using that word here even after repeated warnings, the moderator is going to ban you. I am not kidding. I have read about NSDate, NSTimer but

Re: super respondsToSelector

2008-05-30 Thread Andrew Farmer
On 30 May 08, at 23:22, Russ McBride wrote: Anyone want to take a stab at explaining to me as thoroughly as possible why [super respondsToSelector: aSelector] doesn't actually do what it looks like it should do? Keep in mind that, ordinarily, respondsToSelector: is implemented on N

Re: super respondsToSelector

2008-05-30 Thread Jens Alfke
On 30 May '08, at 11:22 PM, Russ McBride wrote: Anyone want to take a stab at explaining to me as thoroughly as possible why [super respondsToSelector: aSelector] doesn't actually do what it looks like it should do? Sure. "super" does not mean "my superclass". It means "self, but st

How can i get current system time?

2008-05-30 Thread haresh vavdiya
Hi team, Thank for giving me answer. I want to do one small clock for my iPhone but i can't understand how can i get current system time? I have read about NSDate, NSTimer but i can't understand how to use that class for getting current system time? Please guide me

Re: super respondsToSelector

2008-05-30 Thread stephen joseph butler
On Sat, May 31, 2008 at 1:22 AM, Russ McBride <[EMAIL PROTECTED]> wrote: > It seems like either an infinite loop should occur if respondsToSelector is > really being called on self, or it should return NO if it's called on super, > in which case my delegate method in self should never get called.

super respondsToSelector

2008-05-30 Thread Russ McBride
Anyone want to take a stab at explaining to me as thoroughly as possible why [super respondsToSelector: aSelector] doesn't actually do what it looks like it should do? Bonus points if you can explain why I can override the respondsToSelector:(SEL)aSelector method in my object and a

Re: Changing button title based on single or multiple selection?

2008-05-30 Thread stephen joseph butler
On Fri, May 30, 2008 at 11:43 PM, Rick Mann <[EMAIL PROTECTED]> wrote: > I'm sure this has been asked before, but a brief Google search didn't turn > up anything. > > I have a button "Print Label". I would like it to say "Print Labels" when > more than one label is selected in the Tree Controller v

Changing button title based on single or multiple selection?

2008-05-30 Thread Rick Mann
I'm sure this has been asked before, but a brief Google search didn't turn up anything. I have a button "Print Label". I would like it to say "Print Labels" when more than one label is selected in the Tree Controller view. Is it possible to do this with Alt. Titles and bindings in IB? Or mu

RESTful API's - Easy way to interact?

2008-05-30 Thread Jeremy
Hey, I am working on my first full fledge application. Now, my problem lies within that all my data and the main functionality of my application is coming from a RESTful API application on the web. I am having trouble sending headers and configuring the authentication and it just cripples

Re: Cocoa bug? release/removeObserver from inside observeValueForKeyPath

2008-05-30 Thread Geoff Schmidt
Thanks to Hamish and Kai for their suggestions - the help is much appreciated. For now, I'm just being careful to autorelease where there is a potential problem, as Kai suggested. (Though I suspect that, in general, it's equivalent to the halting problem to determine which instances of rel

Re: Application support for Time Machine

2008-05-30 Thread Michael Gardner
What are you looking to accomplish with Time Machine? -Michael Ralf Edmund Stranzenbach wrote: > Hi. > > I'm still wondering if there is any plug-in or extension type > architecture that enables applications to cooperate with the TimeMachine > backups much like Apples Mail or AddressBook applica

Re: CGContextSetRGBFillColor() off by one?

2008-05-30 Thread Michael Vannorsdel
This is from the CGColorSpaceCreateDeviceRGB docs: In Mac OS X v10.4 and later, this color space is no longer device- dependent and is replaced by the generic counterpart— kCGColorSpaceGenericRGB—described in “Color Space Names”. If you use this function in Mac OS X v10.4 and later, colors ar

Re: Ending Editing when Doc Saves?

2008-05-30 Thread David Carlisle
After your suggestion, I recalled and reviewed figure 6 about "Saving a Document" in the Document Based Applications Overview. That made it clear to me that saveDocument does call the saveDocumentWithDelegate method. Then I tried your scenario of closing an unsaved doc. Under the old im

Re: Ending Editing when Doc Saves?

2008-05-30 Thread Mike Abdullah
On 30 May 2008, at 20:33, David Carlisle wrote: This is the approach I ended up taking: // in MyDocument.m - (void) saveDocument:(id)sender { [[self windowControllers] makeObjectsPerformSelector:@selector(myPrepareToSave:)]; [super saveDocument:sender]; } // in MyWindow.m - (void)

Re: Application support for Time Machine

2008-05-30 Thread Nick Zitzmann
On May 30, 2008, at 3:44 PM, Ralf Edmund Stranzenbach wrote: I'm still wondering if there is any plug-in or extension type architecture that enables applications to cooperate with the TimeMachine backups much like Apples Mail or AddressBook application. Does anyone know, how those things m

Re: warning: 'NSEntityDescription' may not respond to

2008-05-30 Thread Ben Trumbull
The compiler only knows about methods declared somewhere or the headers, and Core Data accessor methods are handled at runtime and not declared anywhere. It's only a warning and not an error because the compiler is smart enough to know that Objective C can do cool stuff like that. One solut

Application support for Time Machine

2008-05-30 Thread Ralf Edmund Stranzenbach
Hi. I'm still wondering if there is any plug-in or extension type architecture that enables applications to cooperate with the TimeMachine backups much like Apples Mail or AddressBook application. Does anyone know, how those things might be accomplished ? regards Ralf Edmund Stranzenbach

Re: warning: 'NSEntityDescription' may not respond to

2008-05-30 Thread Steven Hamilton
Thanks everyone. Good answers all round. On 31/05/2008, at 4:51 AM, mmalc crawford wrote: On May 30, 2008, at 3:09 AM, Peter Burtis wrote: The compiler only knows about methods declared somewhere or the headers, and Core Data accessor methods are handled at runtime and not declared anywh

Re: drawer attached to modal window is unresponsive

2008-05-30 Thread Steve Christensen
I dumped the items in the drawer so they wouldn't take up real estate unless needed since they can be on the bulky side. I ended up scrapping the drawer and just putting the items in the window itself. Bigger window but fewer issues. Thanks... steve On May 30, 2008, at 1:16 PM, Andrew Mer

Re: Ending Editing when Doc Saves?

2008-05-30 Thread David Carlisle
I'm binding my NSCollectionView to my NSArrayController, so I expected sending a commitEditing to the NSArrayController would work. On May 30, 2008, at 2:09 PM, Kyle Sluder wrote: On Fri, May 30, 2008 at 3:33 PM, David Carlisle <[EMAIL PROTECTED]> wrote: The myPrepareToSave method in MyWindo

Re: drawer attached to modal window is unresponsive

2008-05-30 Thread Jonathan Hendry
I believe a drawer is actually treated as a separate window, which probably confuses things when attached to a window that is modal. I'm not sure why the tableview scrolls, but this would explain why the other controls aren't accessible. Perhaps you could move the drawer contents into an ar

Re: Ending Editing when Doc Saves?

2008-05-30 Thread David Carlisle
I'm not using Core Data. Perhaps that is part of why commitEditing doesn't work. I also mistakenly thought that NSWindowController was an NSController, and would respond to a commitEditing. DC On May 30, 2008, at 2:17 PM, Sean McBride wrote: Are you using Core Data? Have you seen: __

Re: Ending Editing when Doc Saves?

2008-05-30 Thread Sean McBride
On 5/28/08 9:15 PM, David Carlisle said: >If I'm adding text to an NSTextField, then I select Save, somehow the >message needs to get to the NSTextField wherever it is that it needs >to terminate editing and send its contents to the model before the >model is saved. I don't see how I should go ab

Re: drawer attached to modal window is unresponsive

2008-05-30 Thread Andrew Merenbach
Hi, Steve! My experience is that drawers have always been buggy -- and drawers have had issues with Garbage Collection, too, under Leopard (although I haven't tested any drawers in a GC app since I upgraded from 10.5.2 to to 10.5.3 the other day). Also, I've read on this list that drawers

Re: Copying NSTextStorage

2008-05-30 Thread Kyle Sluder
On Fri, May 30, 2008 at 11:13 AM, Gordon Apple <[EMAIL PROTECTED]> wrote: >Why NSTextStorage? Because that is what Sketch uses, and I lifted as > much code from there as I could, although I use my own Bezier text container > when rendering it. The floating NSTextView uses it directly. I supp

Re: Ending Editing when Doc Saves?

2008-05-30 Thread Kyle Sluder
On Fri, May 30, 2008 at 3:33 PM, David Carlisle <[EMAIL PROTECTED]> wrote: > The myPrepareToSave method in MyWindow allowed me to experiment with the > commitEditing method. I tried sending it to either my NSWindowController or > to the NSArrayController which is bound to the NSCollectionView whic

Re: PDFDocuments and CGPDFDocuments

2008-05-30 Thread John Calhoun
On May 29, 2008, at 6:50 PM, Kevin Ross wrote: I think there has to be either a better way of doing this or a way to do it where I will not have to convert (PDFDocument *) to CGPDFDocumentRef every time I perform a transformation. Joel was right. I think it would be easier for you to stay in

drawer attached to modal window is unresponsive

2008-05-30 Thread Steve Christensen
I'm working on a plugin that needs to do some involved setup, and I'm handling this in a modal window since the setup has to be done in an atomic fashion. The window also has an attached drawer. What I'm finding is that I can open and close the drawer, and a table view in the drawer will sc

Re: CGContextSetRGBFillColor() off by one?

2008-05-30 Thread Ken Ferry
> Well... I'm not sure that's true any more is it? I mean, don't all the > DeviceXXX colour spaces get mapped to the new "Generic" ones as of 10.4? I don't believe so, and that isn't what I see in testing. I filed a bug for this yesterday. My understanding, which may be flawed, is that using a

Re: Ending Editing when Doc Saves?

2008-05-30 Thread David Carlisle
This is the approach I ended up taking: // in MyDocument.m - (void) saveDocument:(id)sender { [[self windowControllers] makeObjectsPerformSelector:@selector(myPrepareToSave:)]; [super saveDocument:sender]; } // in MyWindow.m - (void) myPrepareToSave:(id)sender { [[self window

Re: warning: 'NSEntityDescription' may not respond to

2008-05-30 Thread mmalc crawford
On May 30, 2008, at 3:09 AM, Peter Burtis wrote: The compiler only knows about methods declared somewhere or the headers, and Core Data accessor methods are handled at runtime and not declared anywhere. It's only a warning and not an error because the compiler is smart enough to know that

Re: NSTextView and changing the selected text's color

2008-05-30 Thread Gary L. Wade
As for the color choices to use when drawing selected color text, what I've found most readable to my users is to continue using the selection color as chosen by the user but to draw the text shadowed as the Finder does it, with the text being white and the shadow color being the color of the t

Re: Foundation Tool works™ from XCode, bu t eventually fails from CL

2008-05-30 Thread Douglas Davidson
On May 30, 2008, at 10:51 AM, Robert Kukuchka wrote: I've written a very basic foundation tool who's sole purpose is to save incoming serial data from a cu.foo socket into a log file that I create. Real simple stuff here. Oddly, when I run the executable in Release mode from within XCode

Re: warning: 'NSEntityDescription' may not respond to

2008-05-30 Thread Fritz Anderson
On 30 May 2008, at 4:17 AM, Steven Hamilton wrote: Also, any warnings or errors I get in xcode appear twice in the bubbles. Anyone know why that is? By default, new Xcode projects are set to the "Release" configuration (because all software is ready to release when you begin coding it. Th

Foundation Tool works™ from XCode, but even tually fails from CL

2008-05-30 Thread Robert Kukuchka
Hello all, I've written a very basic foundation tool who's sole purpose is to save incoming serial data from a cu.foo socket into a log file that I create. Real simple stuff here. Oddly, when I run the executable in Release mode from within XCode (Apple + R) I get no problems, and it merr

Re: newbie question: menu item appears when app runs, but is not visible in NIB

2008-05-30 Thread Gary L. Wade
If you did that with the version of your NIB that was showing the extra menu item when running your application that you did not see in the Interface Builder edit mode, then things are really weird, unless, of course, you have some code that added that menu item, but that's not something one do

Re: CGContextSetRGBFillColor() off by one?

2008-05-30 Thread Alastair Houghton
On 30 May 2008, at 02:21, Ken Ferry wrote: Well, if you use CGContextSetRGBFillColor as you said, then that sets a device RGB colorspace up as the fill colorspace, and device colorspaces don't do color matching. Device means 'untagged'. Which is to say, I don't know, sounds strange. Well...

Re: Support saving to network volumes

2008-05-30 Thread Alastair Houghton
On 30 May 2008, at 07:52, Robert Cerny wrote: Sorry for arguing with you, but it's cocoa question. But I could be probably more specific - is there anything I need to do to support saving to network volumes using this method? - (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag We

Re: NSURLConnection sendSynchronousRequest crash

2008-05-30 Thread Colin Cornaby
: slaps forehead : Yeah, it's thread two that crashed... #0 0x900686ec in objc_msgSend #1 0x901a85da in CFRelease #2 0x970a1152 in __CFHTTPMessageDeallocate #3 0x901a8788 in _CFRelease #4 0x970ae4a9 in _CFHTTPReadStreamReadMark #5 0x970ae376 in prepareReception #6

Re: NSURLConnection sendSynchronousRequest crash

2008-05-30 Thread Shawn Erickson
On Fri, May 30, 2008 at 8:35 AM, Colin Cornaby <[EMAIL PROTECTED]> wrote: > Strangely enough, I actually was already disabling the cache in my > NSURLRequest. I changed the disable caching flag to the newer constant > (NSURLRequestReloadIgnoringLocalCacheData), and now the crash has changed... > >

Re: NSURLConnection sendSynchronousRequest crash

2008-05-30 Thread Colin Cornaby
Strangely enough, I actually was already disabling the cache in my NSURLRequest. I changed the disable caching flag to the newer constant (NSURLRequestReloadIgnoringLocalCacheData), and now the crash has changed... #0 0x90e684a6 in mach_msg_trap #1 0x90e6fc9c in mach_msg #2 0

Re: NSTextView and changing the selected text's color

2008-05-30 Thread Ross Carter
Instead of NSTextView setMarkedTextAttributes:, I think you want to look at setSelectedTextAttributes:. "Marked text" refers to text input that is not final. When you type option-e, NSTextView displays an accent glyph with a yellow background. That's marked text. When you type a letter, the

Re: Copying NSTextStorage

2008-05-30 Thread Gordon Apple
Yes, I did try mutable copy (which still required intercepting the "text" key when copying the shape). It didn't help. I inserted some test code to try to figure out why it was crashing my program. The NSTextStorage, when copied, would blow up when asking for layoutManagers. (I was tryi

Re: NSURLConnection sendSynchronousRequest crash

2008-05-30 Thread Jens Alfke
On 30 May '08, at 12:55 AM, Colin Cornaby wrote: I'm using an NSURLConnection to heavily query a server (basically I'm abstracting a MySQL database, and I have a Hessian server (basically SOAP) on the other end handling requests.) However, I keep having sendSyncronousRequest crash on me af

Re: Support saving to network volumes

2008-05-30 Thread Jens Alfke
On 29 May '08, at 11:52 PM, Robert Cerny wrote: but it's cocoa question. But I could be probably more specific - is there anything I need to do to support saving to network volumes using this method? - (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag That'll work fine. Be sure to

Re: sorting an NSTableView

2008-05-30 Thread Ken Worley
On May 30, 2008, at 12:48 AM, James W. Walker wrote: Hi. I'm a Cocoa newbie, and I'm trying to figure out how to enable sorting columns of my table, but the NSTableView guide doesn't say anything about it. I see that NSTableView has a setSortDescriptors method, NSTableColumn has a setSor

Re: warning: 'NSEntityDescription' may not respond to

2008-05-30 Thread Kyle Sluder
On Fri, May 30, 2008 at 6:09 AM, Peter Burtis <[EMAIL PROTECTED]> wrote: > One solution is to use [managedObject valueForKey:@"memo"] and > [managedObject setValue:@"test123" forKey:@"memo"] instead of the accessors. And another, if you ever want to add custom logic, is to declare memo as a @prope

Re: warning: 'NSEntityDescription' may not respond to

2008-05-30 Thread Peter Burtis
The compiler only knows about methods declared somewhere or the headers, and Core Data accessor methods are handled at runtime and not declared anywhere. It's only a warning and not an error because the compiler is smart enough to know that Objective C can do cool stuff like that. One so

Re: Another newbie question

2008-05-30 Thread Erik Buck
A better subjuct might have been "How should I use interface objects to select command line arguments?" or something like that. The current subject adds no value and will not help others search for information in the future. Having said that... One approach you might take (that will

Re: sorting an NSTableView

2008-05-30 Thread Vijay Malhan
An Example: mTable = member instance for your TableView mData = member array which provides the data-objects. Put the following code at a place where your table and data-source array is initialized. Like in awakeFromNib: method. Here I'm sorting on key "name", Change it to whatever key you ha

Re: Hii I have problem in

2008-05-30 Thread Vijay Malhan
On Fri, May 30, 2008 at 1:26 PM, haresh vavdiya < [EMAIL PROTECTED]> wrote: > Ya but i have retained my stringRes instance variable but i can't > understand > what is problem We can't see that in your code. Use: self.stringRes = txtResult.text; and declare a retain-property for your string ivar.

NSTextView and changing the selected text's color

2008-05-30 Thread Mattias Arrelid
Hi everyone, We have a subclass of NSTextView (SPTextView). A couple of these have some text with [NSColor grayColor] set as the NSForegroundColorAttributeName. It looks good, but when the user starts selecting text things go bad™. Since grey on light blue (the default system selection color) isn

warning: 'NSEntityDescription' may not respond to

2008-05-30 Thread Steven Hamilton
Hi folks, I have a custom datasource that does a fetch from Core Data. My entity has a property in it called 'memo'. When I enumerate the returned array to check the results I get the following warning. warning: 'NSEntityDescription' may not respond to '-memo' The fetch appears to work o

Re: Cocoa bug? release/removeObserver from inside observeValueForKeyPath

2008-05-30 Thread Kai
On 30.5.2008, at 00:53, Hamish Allan wrote: On Thu, May 29, 2008 at 11:15 PM, Geoff Schmidt <[EMAIL PROTECTED] > wrote: 3) If this is already known, is there a customary pattern for avoiding the problem? "Never release from observeValueForKeyPath" is a bit harsh! I don't know if it's kno

Re: Hii I have problem in

2008-05-30 Thread haresh vavdiya
Ya but i have retained my stringRes instance variable but i can't understand what is problem On Fri, May 30, 2008 at 10:00 AM, Andrew Farmer <[EMAIL PROTECTED]> wrote: > On 29 May 08, at 21:13, haresh vavdiya wrote: > >> I m doing tic tac toc game and i have completed most of the parts. >> But on

NSURLConnection sendSynchronousRequest crash

2008-05-30 Thread Colin Cornaby
I'm using an NSURLConnection to heavily query a server (basically I'm abstracting a MySQL database, and I have a Hessian server (basically SOAP) on the other end handling requests.) However, I keep having sendSyncronousRequest crash on me after periods of heavy load. The stack trace is: #