Re: Core data fetch and multithreading

2010-11-22 Thread Quincey Morris
On Nov 21, 2010, at 23:14, vincent habchi wrote: > I intended to lock, fetch the entity, read the corresponding attribute, and > unlock. That's all I've to do. On the main thread, I lock when I mutate the > set, then unlock. That's all in one place, so it's not so difficult to figure > out. *T

How to avoid multiple clicks on a push button

2010-11-22 Thread Abhijeet Singh
Hi,I am working on a user interface. There is only one window in my application with Back and Next buttons on it. On Next / Back button click my application performs some task and the current view is swapped with another view in the window. It works fine until somebody clicks Next (or Back) butt

Asking an outline/table view to send it's setObjectValue:... message

2010-11-22 Thread Thomas Davie
Hi, I'm writing a custom cell at the moment that's used in an outline view, it's object value changes sometimes when the outline view doesn't expect it to (which seems to be only on mouse down or end editing). Is there some way I can force the outline view to send it's - (void)outlineView:(NSO

Re: How to avoid multiple clicks on a push button

2010-11-22 Thread Mike Abdullah
Tell us more. In what way does this "mess up the whole functionality" of the application? On 22 Nov 2010, at 09:54, Abhijeet Singh wrote: > Hi,I am working on a user interface. There is only one window in my > application with Back and Next buttons on it. On Next / Back button click my > appli

Re: Subclasses, protocols and properties - compiler warning

2010-11-22 Thread Jonny Taylor
>> I am encountering what I believe to be a spurious compiler warning. I wonder >> whether this is a clue that I am doing something differently to how I >> "should" do it. The problem comes if I define a protocol containing a >> property and then define that property in a base class that does NO

Re: Core data fetch and multithreading

2010-11-22 Thread vincent habchi
Quincey: I am a bit in a hurry, so I will answer quickly: > I think maybe you have more design options here. For example, you can [in > principle, I think] multithread with a single MOC without locks if you pass > "ownership" of the MOC around between threads that make changes, so that > owner

NSTextView auto_refcount_underflow_error during spell check

2010-11-22 Thread jonat...@mugginsoft.com
I have an NSTextView instance on OS X 10.6.3 that persistently logs the following error auto_refcount_underflow_error Breaking on this reveals that the underflow occurs on thread 4 in NSTextCheckingOperation. I haven't seen this behaviour before with NSTextView so I am pretty certain that a mis

Re: Asking an outline/table view to send it's setObjectValue:... message

2010-11-22 Thread Keary Suska
On Nov 22, 2010, at 4:09 AM, Thomas Davie wrote: > I'm writing a custom cell at the moment that's used in an outline view, it's > object value changes sometimes when the outline view doesn't expect it to > (which seems to be only on mouse down or end editing). Is there some way I > can force t

Re: unit test exit's abnormally with code 5

2010-11-22 Thread Shane
Still trying to get my unit tests to build. I have an app project which includes unit tests as well, and it depends on another dylib project. They're all built with GCC_ENABLE_OBJC_GC as unsupported. AFAIK, that's off. So everything ought to be turned of with respect to GC. And according to the out

Re: Core data fetch and multithreading

2010-11-22 Thread Hunter Hillegas
I think someone somewhere told me that if you create a MOC on the main thread, there's some special runloop integration that is included, hence one of the reasons it's important to not create one on the main thread and then pass it around. This is also important to keep in mind re: NSOperation,

[NSDate] Bug in dateByAddingTimeInterval: on Mac OS X 10.5

2010-11-22 Thread Stephane Sudre
According to the NSDate.h header: - (id)dateByAddingTimeInterval:(NSTimeInterval)ti AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER; Problem is when I run the following code on Mac OS X 10.5 on a PowerMac G5, I get the result listed below. #import int main (int argc, const char * argv[]) { NSAut

Re: [NSDate] Bug in dateByAddingTimeInterval: on Mac OS X 10.5

2010-11-22 Thread Jeff Johnson
Hi Stephane. I believe that the header is mistaken. According to the documentation, dateByAddingTimeInterval: is "Available in Mac OS X v10.6 and later." http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSDate_Class/Reference/Reference.html#//apple_ref/occ/

Infinite Loop invoking super ?? -[NSDocument canCloseDocumentWithSelector:::]

2010-11-22 Thread Jerry Krinock
I received a strange crash report from a user. User says it is not reproducible. The way I read this, an infinite loop occurred in my NSPersistentDocument subclass of -canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo: when my code invoked super. Here is the crash report. Thread

Re: Loading NSManagedObjects across NSManagedObjectContexts in an unsaved NSPersistentDocument

2010-11-22 Thread Dave Zwerdling
Hello again; Well, I ran some debugging and I determined that ALL I needed was an initial save. After that, all the core data stores are up-to-date, and faults result in actual fetched data. So, although kind of kludgy, I accepted the "Initial Save" behavior à la Garageband, where the user is

Re: Infinite Loop invoking super ?? -[NSDocument canCloseDocumentWithSelector:::]

2010-11-22 Thread Ken Thomases
On Nov 22, 2010, at 11:32 AM, Jerry Krinock wrote: > How can there be an infinite loop invoking super in a method? Looks like it > was re-invoking itself instead of invoking super. Busted method or isa swizzling, maybe? Or a memory smasher that messed up the dispatch table? Regards, Ken ___

Re: Infinite Loop invoking super ?? -[NSDocument canCloseDocumentWithSelector:::]

2010-11-22 Thread Kyle Sluder
On Mon, Nov 22, 2010 at 10:31 AM, Ken Thomases wrote: > On Nov 22, 2010, at 11:32 AM, Jerry Krinock wrote: > >> How can there be an infinite loop invoking super in a method?  Looks like it >> was re-invoking itself instead of invoking super. > > Busted method or isa swizzling, maybe?  Or a memory

Re: Running JavaScript in iOS WebView.

2010-11-22 Thread Geoffrey Holden
Okay, I've verified that the page has loaded correctly (by running [webView stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML"] to output the HTML of the loaded webview and then comparing it with the page loaded by the Mac version to ensure that they're the same.) I've come to th

Re: Core data fetch and multithreading

2010-11-22 Thread Quincey Morris
On Nov 22, 2010, at 07:58, Hunter Hillegas wrote: > I think someone somewhere told me that if you create a MOC on the main > thread, there's some special runloop integration that is included, hence one > of the reasons it's important to not create one on the main thread and then > pass it aroun

Re: how to add a custom view (a pair of controls) to an NSToolbar in Interface Builder

2010-11-22 Thread Rua Haszard Morris
Any suggestions on how to do this? I simply want to use a bunch of controls, grouped via a custom view, in a toolbar, such that the controls form a single toolbar item (for add/remove), but the individual controls respond to mouse, draw, etc as normal. Is this not possible? thanks Rua HM. On

iPad: Distribution of documents

2010-11-22 Thread Phillip Mills
I'm working on an application that lets a user create 'documents' that will live in the app's Documents directory. I'd like to distribute some sample documents that would be treated the same as anything the user creates, but haven't seen anything that suggests I can have XCode populate Document

Re: iPad: Distribution of documents

2010-11-22 Thread Hunter Hillegas
As far as I know, this is the way to go. For instance, it's a common thing with pre-populated Core Data databases that you are going to want to write to. On Nov 22, 2010, at 3:16 PM, Phillip Mills wrote: > It seems easy enough to stick them into the main bundle as resources and then > copy them

Re: how to add a custom view (a pair of controls) to an NSToolbar in Interface Builder

2010-11-22 Thread Graham Cox
On 23/11/2010, at 10:02 AM, Rua Haszard Morris wrote: > Is this not possible? Yes, it's possible. But your question is too open-ended. What have you tried, what doesn't perform as expected? --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.app

NSView exitFullScreenModeWithOptions results in dimmed menus in document based app

2010-11-22 Thread Jon Gilkison
When I call exitFullScreenModeWithOptions in a document based app, the menu items are permanently dimmed out. I've tried making everything I can think of firstResponder, but still dimmed out. I tried a couple of alternate full screen methods, to see if I could get around it, but I'm using a layer

Re: how to add a custom view (a pair of controls) to an NSToolbar in Interface Builder

2010-11-22 Thread Rua Haszard Morris
What I have tried: - new window NIB file - add a toolbar - add a custom view to the nib - add controls to the custom view - a button, textfield, etc, tweak layout to taste - drag the custom view to the toolbar customise sheet (i.e. the allowed items area) - it looks like the view content will app

Help diagnosing networking/internet performance issues

2010-11-22 Thread Graham Cox
In working on some networking code, I've come across one test machine on our local net that has extremely slow performance. Like orders of magnitude slower than normal, on the same local network and using the same method (airport, through a single router) as other machines that work just fine. T

Re: Help diagnosing networking/internet performance issues

2010-11-22 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/22/10 5:31 PM, Graham Cox wrote: > In working on some networking code, I've come across one test machine > on our local net that has extremely slow performance. Like orders of > magnitude slower than normal, on the same local network and using th

Obtaining all points on a line segment

2010-11-22 Thread Cody Garvin
Hi all, I searched back through 2005 in the Cocoa Mailing List and didn't see any requests for this. We need all the points on a line / arc / path on the screen. We need to do hit detection on stroked line, so we must know if the point is valid or not. I thought using CGPathContainsPoint woul

Odd problem with event taps when job is killed

2010-11-22 Thread George Nachman
Hi cocoa-dev, I recently added an event tap to my program. Since doing that, there is a strange behavior: when I kill my job (usually by making a change in Xcode and pressing cmd-Enter, being prompted to kill the job, and selecting OK), it will repeat back the last 10-20 keypresses as or after it

Re: Help diagnosing networking/internet performance issues

2010-11-22 Thread Dave Keck
Perhaps the bandwidth has been limited using ipfw or a similar utility? ___ 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 cocoa-dev-admins(at)lists.apple

Re: Obtaining all points on a line segment

2010-11-22 Thread Dave DeLong
It seems to me that a simpler way to do this would be: - get the endpoints of the line - figure out the slope of the line - If the slope is <= 1, pull out the x coordinate of the test point. If the slope is > 1, use the y coordinate of the test point - using the algebra that you learned when you

Re: NSExpression is incorrect?

2010-11-22 Thread Dave DeLong
Thanks for this suggestion, Ben. I ultimately went with a combination of this suggestion (dynamically determining associativity) and Ronald's suggestion (allowing the user to choose). My parser will start with the associativity used by NSExpression, but provides a property to change it. Thank

Radio dial buttons [iOS]

2010-11-22 Thread Development
A while back I saw an app that had dials to adjust certain settings. I could have sworn there was example code related to it. Anyway. I'm wondering if any of you might know where I could look to find information on creating dials for iPhone/iPad. I've been googling for a bit and all I can come u

[ANN] DDMathParser

2010-11-22 Thread Dave DeLong
Hi everyone, I thought it'd be fun to write a mathematical expression evaluator, a la Graham Cox's GCMathParser, but one that was extensible. So I dusted off my parsing skills and wrote DDMathParser: https://github.com/davedelong/DDMathParser It's an NSString => NSNumber expression evaluator,

Re: Obtaining all points on a line segment

2010-11-22 Thread Graham Cox
Hit testing of lines/paths can basically be done in two ways: a) mathematically, in that you determine whether a given point is close to a given line by calculation b) graphically, in that you draw the line into some image and test the pixel drawn. I've done quite a bit of work on this in the p

Re: [ANN] DDMathParser

2010-11-22 Thread Graham Cox
Ah, nice job! It's about time my crusty old code was updated but I'm just too busy... --Graham On 23/11/2010, at 3:41 PM, Dave DeLong wrote: > Hi everyone, > > I thought it'd be fun to write a mathematical expression evaluator, a la > Graham Cox's GCMathParser, but one that was extensible.

Re: Help diagnosing networking/internet performance issues

2010-11-22 Thread Graham Cox
On 23/11/2010, at 12:31 PM, Graham Cox wrote: > In working on some networking code, I've come across one test machine on our > local net that has extremely slow performance. OK, looks like my Airport hardware is up the swanee. Cut a long story short - none of the suggested diagnostics turned

Objective-C Mind Map Libraries

2010-11-22 Thread Andrew McLaughlin
Hi guys (and gals), I'm new to the Objective-C arena and am still getting my bearings. Besides the amazing set of libraries that Apple provides in the SDK, is there an open source repository elsewhere of Objective-C libraries that can be used in development? Specifically, I'm looking for a Sour

NSDebug.h where?

2010-11-22 Thread Laurent Daudelin
Trying to access this header to check its content and I don't find it in the Foundation framework anymore for iOS. So, where is it now? All references I find while "googling" it refers to pages that were updated in 2002 and 2003, nothing recent. Have I been sleeping all those years and missed i

Re: [ANN] DDMathParser

2010-11-22 Thread Carter Allen
Hey Dave, I'm currently working on an app that loads expressions from plugin-like files, and currently we're having the expressions be written in JavaScript syntax and then using a WebView to evaluate the JavaScript. Obviously, this is less than ideal. I'm wondering if you think that DDMathPars

Re: Core data fetch and multithreading

2010-11-22 Thread Chris Hanson
On Nov 21, 2010, at 11:47 AM, vincent habchi wrote: > briefly speaking, I have a Core Data Entity bearing a to-many relationship > (therefore an NSSet * iVar). A dialog on the main thread can modify this set, > while it may be simultaneously enumerated on a background GCD thread. I have > ther

Re: Core data fetch and multithreading

2010-11-22 Thread Chris Hanson
On Nov 22, 2010, at 1:08 PM, Quincey Morris wrote: > On Nov 22, 2010, at 07:58, Hunter Hillegas wrote: > >> I think someone somewhere told me that if you create a MOC on the main >> thread, there's some special runloop integration that is included, hence one >> of the reasons it's important to