Re: initWithNibName:nil not working for UITableViewController?

2010-08-16 Thread Jason Foreman
Hi Matt, On Fri, Aug 13, 2010 at 8:45 PM, Matt Neuburg wrote: > But I had expected initWithNibName: to follow the rule documented under > UIViewController: > > "If you specify nil for the nibName parameter and do not override the > loadView method in your custom subclass, the default view contro

Re: NSURLConnection POST issues

2010-01-09 Thread Jason Foreman
On Jan 9, 2010, at 9:31 PM, Damien Cooke wrote: > here is my code to send this data > > [appendedData appendData:[[[NSString > stringWithFormat:@"ProdName=%@",[self applicationName]] > stringByAddingPercentEscapesUsingEncoding: NSASCIIStringEncoding] > dataUsingEncoding:NSASCIIStringEn

Re: NSOutlineView expand-by-default with NSTreeController

2009-12-05 Thread Jason Foreman
On Dec 5, 2009, at 12:43 PM, Benjamin Rister wrote: > I have an NSOutlineView in which I would like to have newly-appearing items > be expanded by default. (It would be nice if NSOutlineView had support for > this built in; rdar://problem/7421928.) > > The list archives and a web search reveal

Re: Best way to hook into the run loop?

2009-12-04 Thread Jason Foreman
On Dec 4, 2009, at 7:18 AM, Graham Cox wrote: > I'm looking at the docs now, and for this use, it seems I would want > kCFRunLoopAfterWaiting to OPEN any undo groups, because that's just before > processing an event, but it's a little less clear when I should do the > automatic close. Presumab

Re: Best way to hook into the run loop?

2009-12-03 Thread Jason Foreman
On Dec 3, 2009, at 10:17 PM, Graham Cox wrote: > One thing I'd like to do is to match NSUndoManager's ability to automatically > open and close groups as the run loop cycles. What's the best way to do this? Possibly by using a CFRunLoopObserver. You can look into CFRunLoopObserverCreate and t

Re: UI Question: Hide application window after minimising

2009-11-20 Thread Jason Foreman
On Nov 20, 2009, at 2:02 AM, Michael Davey wrote: > Hi there, > > This is my first post, so please be gentle ;o) > > I am writing an application using obj-c/Cocoa and I was curious about > something I have seen in another application that I would like mine to be > able to do. > > Basically,

Re: NSObjectController add: Method RunLoop Deferral

2009-11-02 Thread Jason Foreman
On Nov 2, 2009, at 2:51 PM, Richard Somers wrote: I think the problem is with the add: method. The documentation states "Beginning with Mac OS X v10.4 the result of this method is deferred until the next iteration of the runloop so that the error presentation mechanism can provide feedba

Re: favicon of address

2009-09-20 Thread Jason Foreman
On Sep 20, 2009, at 1:53 PM, Mitchell Livingston wrote: Hey, I want to get the favicon of a URL address, but don't actually need any of the page's content. Is there an efficient way to do this besides hammering the site for this info? This image isn't critical, so something that works "m

Re: MutableDictionary setValue:forKeyPath - strange behavior

2009-09-20 Thread Jason Foreman
On Sep 20, 2009, at 1:54 PM, Steve Cronin wrote: Kyle; Thanks for such a speedy response. (and on a Sunday afternoon too!) That code is a fairly complex set of interlocking methods. Why would the construction of this NSMutableDictionary have anything to do with this error? Because the er

Re: getline 'free' problem

2009-09-16 Thread Jason Foreman
On Sep 16, 2009, at 5:41 AM, Aron Nopanen wrote: Hi All, Not a Cocoa problem as such, but not sure if there's a better list for it: For this question, Xcode-users is probably a better list. On Snow Leopard (using gcc 4.2), I'm getting a 'double free' error in the guts of the C++ std::g

Re: CGWindowListCreateImage fails on Snow Leopard with kCGNullWindowID

2009-09-10 Thread Jason Foreman
On Sep 10, 2009, at 12:34 PM, David Duncan wrote: On Sep 10, 2009, at 7:32 AM, Jason Foreman wrote: CGImageRef screenShot = CGWindowListCreateImage(CGRectInfinite, kCGWindowListOptionOnScreenOnly, kCGNullWindowID, kCGWindowImageDefault); On Snow Leopard, the CGImageRef is NULL and the

CGWindowListCreateImage fails on Snow Leopard with kCGNullWindowID

2009-09-10 Thread Jason Foreman
I am attempting to use the CGWindowListCreateImage function to capture a desktop screenshot. The following code (taken straight from the SonOfGrab sample) works on Leopard, but is failing on Snow Leopard: CGImageRef screenShot = CGWindowListCreateImage(CGRectInfinite, kCGWindowListOption

Re: Scripting Bridge link error

2009-09-09 Thread Jason Foreman
On Sep 9, 2009, at 8:52 PM, Randall Meadows wrote: AdobePhotoshopCS3JPEGSaveOptions *options = [AdobePhotoshopCS3JPEGSaveOptions new]; [...] It compiles fine, but I get this link error: Undefined symbols: ".objc_class_name_AdobePhotoshopCS3JPEGSaveOptions", referenced from: literal

Re: Continuous NSTextField not updating bound value continuously?

2009-09-08 Thread Jason Foreman
On Sep 8, 2009, at 1:05 PM, Doug Knowles wrote: Hi, I have a text field (two, actually) bound to a string value in a controller object, and I'd like to validate the value on each keystroke so that I can enable other controls appropriately depending on the content of the field. The text fie

Re: Sheets positioning.

2009-09-08 Thread Jason Foreman
On Sep 8, 2009, at 12:53 PM, Brent Smith wrote: Hello I have a new file dialog that pops up as a sheet, hwoever on the first popup of this sheet, Its not positioned below the titlebar http://i29.tinypic.com/2k287p.jpg But if I hit cancel, and then open the dialog again, Its perfect. http:/

Re: applicationWillTerminate: issue

2009-08-25 Thread Jason Foreman
On Aug 24, 2009, at 10:26 PM, Michael de Haan wrote: -applicationWillTerminate: doesn't magically get called. NSApplication posts this notification to the default notification center. NSApplication also automatically signs its delegate up for this notification. Kyle, from the "Cocoa Fundame

Re: NSTableView and programmatic changing of contextual menu

2009-08-25 Thread Jason Foreman
On Aug 24, 2009, at 7:44 PM, Kyle Sluder wrote: On Mon, Aug 24, 2009 at 5:39 PM, Jack Carbaugh wrote: My question is how do i change the contextual menu when the user right clicks. Override -menuForEvent:. Another way is to implement the - tableView:willDisplayCell:forTableColumn:row:

Re: NSURLRequest- setHTTPMethod to REPORT

2009-05-29 Thread Jason Foreman
On Fri, May 29, 2009 at 4:10 PM, Chris Purcell wrote: > Hello, > > I'm trying to issue a "REPORT" request to a server, the HTTP Method header > needs to look like this: > > REPORT /bernard/work/ HTTP/1.1 > > So I use setHTTPMethod to set the HTTP Method: [theRequest > setHTTPMethod:@"REPORT /berna

Re: how to set horizontal scroller for NSTextView?

2009-05-29 Thread Jason Foreman
On Fri, May 29, 2009 at 11:20 AM, archana udupa wrote: > Hi list... >  I m new to cocoa. I ve a NSTextview, for which i ve set a > scrollerview. I can scroll it vertically.But i wanted to scroll it > horizontally also. I  ve used [NSScrollView > setHasHorizontalScroller:YES]; But i m wondering why

Re: Message from view to viewController

2009-05-29 Thread Jason Foreman
On Fri, May 29, 2009 at 11:18 AM, Pierre Berloquin wrote: > Yes, I did import too many times, but that was in a desperate attempt to > import enough!I corrected that and now I have my original error : > MyAppViewController may not respond to +manageMyViews > which blocks the program > You've defi

Re: performSelectorOnMainThread problem SOLVED

2009-05-28 Thread Jason Foreman
On May 28, 2009, at 12:13 PM, Ben Einstein wrote: Thanks for the advice, I had actually tried that as well to no avail. After playing around a bit, I'm fairly certain I've solved it, although I'm not really sure why it was a problem. At the top of the worker method, I was locking the NSMan

Re: Newbie question on listing out detailed items

2009-05-22 Thread Jason Foreman
On May 22, 2009, at 5:33 PM, Stamenkovic Florijan wrote: What I want: a listout of items, each of which presents info and a number of controls. Typical example: Safari's downloads window. ... Any pointers to documentation on how to deal with this would be very appreciated. Perhaps I am si

Re: Integer as key in NSMutableDictionary

2009-05-04 Thread Jason Foreman
On May 4, 2009, at 2:22 AM, Weydson Lima wrote: I am getting warnings when adding integers in the array and assigning the integer ID as a key. The code does work though, but I am guessing there is a better way to accomplish what I want. I know that these methods are expecting pointers as paramet

Re: Core Data and the Application Delegate

2009-04-24 Thread Jason Foreman
On Apr 24, 2009, at 7:47 PM, Jon Gordon wrote: On Apr 24, 2009, at 4:40 PM, Jason Foreman wrote: On Apr 23, 2009, at 7:37 PM, Jon Gordon wrote: But I understand (I think) also that, in a Core Data document- based application, the application delegate is set to one provided by Core Data

Re: Core Data and the Application Delegate

2009-04-24 Thread Jason Foreman
On Apr 23, 2009, at 7:37 PM, Jon Gordon wrote: But I understand (I think) also that, in a Core Data document-based application, the application delegate is set to one provided by Core Data. And in such cases, providing my own delegate breaks Core Data functionality that I'd otherwise get fo

Re: Why doesn't this work on my device?

2009-02-26 Thread Jason Foreman
On Thu, Feb 26, 2009 at 3:37 PM, James Cicenia wrote: > Why doesn't this work on the device? > Help this is causing me hours of grief with errors like these. What errors? You haven't shown any, just code. Define "doesn't work" and you'll get better help. >if (sqlite3_open([path UTF8String]

Re: Needed : set class for Cocoa

2009-02-05 Thread Jason Foreman
You could throw the pointers into NSValue objects and store those in an NS[Mutable]Set.. Jason On Feb 5, 2009, at 5:29 PM, Tommy Nordgren wrote: Do anyone know of a set container class for Cocoa objects, that use pointer semantics. Like this: NSMutableString * s1 = [@"Hello" muta

Re: Why does NSTableView stop responding to validateMenuItem: ?

2009-01-29 Thread Jason Foreman
On Thu, Jan 29, 2009 at 2:37 PM, Doug Knowles wrote: > And why is the exception only thrown infrequently (and persistently once it > starts), when it's normally successfully invoked every time a click on the > respective menu? The real question is why is the exception not thrown every time. NSTab

Re: NIB's owner doesn't get released because of NSArrayController

2009-01-15 Thread Jason Foreman
On Thu, Jan 15, 2009 at 10:04 AM, Vitaly Ovchinnikov wrote: > - (void) dealloc > { >// next two lines added after your comment >[pView release]; >[pArrayController release]; > >[super dealloc]; > } This won't work as you intend, see below for explanation. > > In the main window c

Re: NIB's owner doesn't get released because of NSArrayController

2009-01-15 Thread Jason Foreman
On Wed, Jan 14, 2009 at 11:58 PM, Vitaly Ovchinnikov wrote: > Well, OK. I am ready to release all root objects myself. Just tested > with subclassed NSView from that NIB - it didn't get released > automatically. > So I added several -release calls to -dealloc method of my NIB's owner > and now it

Re: NIB's owner doesn't get released because of NSArrayController

2009-01-14 Thread Jason Foreman
On Wed, Jan 14, 2009 at 3:51 PM, Vitaly Ovchinnikov wrote: > Hello all, > > I have a custom-loaded NIB file with NSView and NSArrayController. > Array controller is bound to file's owner (NSObject's derived class) > and use some keypath for contentArray. The problem is when I close a > window and

Re: Odd EXEC_BAD_ACCESS after executing URLRequest [SOLVED]

2009-01-07 Thread Jason Foreman
On Wed, Jan 7, 2009 at 9:43 AM, marc hoffman wrote: > > wow, that was indeed it. odd, i could have /sworn/ i had seen a separate > class method in the docs with a "shouldStart" parameter, and that this one > was supposed to not start it. teaches me to trust my memory ;P Well, your memory isn't *t

Re: Works in main Thread, but not in background Thread (modified)

2009-01-07 Thread Jason Foreman
Hi John, On Wed, Jan 7, 2009 at 9:01 AM, John Love <> wrote: > NSWorkspace *workSpace = [NSWorkspace sharedWorkspace]; > Let me wrap this up by saying when myRoutine is called in my main thread, > everything works fine .. but when called by my background thread (via > [NSThread detachN

Re: Odd EXEC_BAD_ACCESS after executing URLRequest

2009-01-06 Thread Jason Foreman
Hi Marc, On Tue, Jan 6, 2009 at 2:42 AM, marc hoffman wrote: > > any other ideas? > I did notice one thing from your original code: > NSURLConnection *conn = [[NSURLConnection connectionWithRequest:request > delegate:self] retain]; > @try > { > [conn start]; The way you

Re: Odd EXEC_BAD_ACCESS after executing URLRequest

2008-12-30 Thread Jason Foreman
On Tue, Dec 30, 2008 at 10:10 AM, marc hoffman wrote: >while (!done) >{ >[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode > beforeDate:[NSDate dateWithTimeIntervalSinceNow:timeout]]; >} > Since you want the request to happen synchronousl

Re: Sizing text to fit into UITextView

2008-12-29 Thread Jason Foreman
On Mon, Dec 29, 2008 at 1:57 PM, Steve Wetzel wrote: > Is there any easy way to change the size of the font so a string will fit > into UITextView? You'll probably want to look at the stuff in the NSString UIKit additions. I believe the category is UIDrawing. There you'll find various methods t

Re: Thread crashing problem

2008-12-22 Thread Jason Foreman
On Dec 22, 2008, at 9:42 AM, Ken Tozier wrote: Problem is, I'm a thread noob so have no idea which type of lock is right for my situation. As to @synchronized, Robert Marini seemed to suggest that that was a Leopard-pnly solution. This app has to work on Tiger as well. As a self professe

Re: how to separate the path name from a file name

2008-12-17 Thread Jason Foreman
On Wed, Dec 17, 2008 at 5:52 AM, wamozart wrote: > Hi, I'm writing an NSDocument class code. I would like to separate the path > name from a file name. > NSString *filename = [self fileName]; > > returns the full path and file name. How do I get the path name only? See this section of the NSStrin