core-data app design question

2009-08-27 Thread Martin Hewitson
Dear list, I have a question, or rather, I'm looking for advice, on the design of an application. Essentially I'm wanting to write a labbook-type application. My plan was to use core-data for the model. In the model will be an Entry entity. Each entry will have a one-to-one relationship t

Core Data Predicate Builder - comparing dates

2009-08-27 Thread Steve Cronin
Folks; I have a Core Data entity that has a dateCreated and a dateModified - both NSDates in the object files. I'd like to construct a predicate that will retrieve all records where a record's dateModified is greater than that record's dateCreated. Its deceptively easy to setup something th

Re: Drawing Text in an NSImage

2009-08-27 Thread Uli Kusterer
On Aug 28, 2009, at 5:13 AM, Seth Willits wrote: drawAtPoint/drawInRect in NSString/NSAttributedString says... "You should only invoke this method when an NSView object has focus." "Don’t invoke this method while no NSView is focused." I think, for the discussion of this particular API, an NS

Re: Making failed NSAsserts crash an app

2009-08-27 Thread Joar Wingfors
Hello Kyle, I would beg to differ: On 27 aug 2009, at 13.23, Kyle Sluder wrote: Strictly speaking I believe you're more accurately describing an invariant than an assertion. Terminology aside, I think that he accurately describes how the Cocoa provided assertion macros are implemented and

Re: Drawing Text in an NSImage

2009-08-27 Thread Henry McGilton (Boulevardier)
On Aug 27, 2009, at 8:13 PM, Seth Willits wrote: drawAtPoint/drawInRect in NSString/NSAttributedString says... "You should only invoke this method when an NSView object has focus." "Don’t invoke this method while no NSView is focused." When an image is focused, and you draw text, it'll defi

Re: creating registration codes

2009-08-27 Thread Nathan Vander Wilt
On Aug 27, 2009, at 9:18 PM, Rick C. wrote: hello, my apologies if this is a bit off-topic, but once an app is done does anyone have a recommendation on how to go about setting up a registration code system for the created app. i guess it needs some programming in partner with some script

creating registration codes

2009-08-27 Thread Rick C.
hello, my apologies if this is a bit off-topic, but once an app is done does anyone have a recommendation on how to go about setting up a registration code system for the created app. i guess it needs some programming in partner with some scripting on the web side. maybe a 3rd parth service?

Drawing Text in an NSImage

2009-08-27 Thread Seth Willits
drawAtPoint/drawInRect in NSString/NSAttributedString says... "You should only invoke this method when an NSView object has focus." "Don’t invoke this method while no NSView is focused." When an image is focused, and you draw text, it'll definitely do wonky things if the currently focused vi

Re: QuickTime Animation Rendering

2009-08-27 Thread Kevin Cathey
(1) Is there a way for me to create the animations with CoreAnimation Layers (CALayer and sublayers) and simply tell some object to write to file? If so, how? Yes, check out CARenderer. This will require some knowledge of OpenGL to do it completely correctly. See rendering to a framebuffer:

Re: Reasons why QL would fail to create thumbnail?

2009-08-27 Thread Graham Cox
On 28/08/2009, at 5:12 AM, Keith Duncan wrote: What is your preview being generated from, a QuickLook generator or the Preview and Thumbnail files in your bundle's QuickLook folder? The bundle's QuickLook folder - I do not have a QL Generator, I just write an image to /QuickLook/Thumbna

Re: Alert dialog in agent app?

2009-08-27 Thread Nick Zitzmann
On Aug 27, 2009, at 5:03 PM, Gabriel Zachmann wrote: My Cocoa application has the plist flag "application is background only" set. (I believe, this is the former LSUIElement property.) No; LSUIElement is still around, but if you have the friendly key view turned on (which is the default s

Re: CALayer drawing delay

2009-08-27 Thread David Duncan
On Aug 27, 2009, at 3:58 PM, David Duncan wrote: By default when the contents of an animation change contents of a layer change, sorry for any confusion... -- David Duncan Apple DTS Animation and Printing ___ Cocoa-dev mailing list (Cocoa-dev@list

Re: Subversion and Interface Builder

2009-08-27 Thread Kyle Sluder
Use XIB? --Kyle Sluder ___ 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.com Help/Unsubscribe/Update your Subscription:

Re: Subversion and Interface Builder

2009-08-27 Thread Jason Sallis
Subversion (and CVS) create .svn/.cvs folders inside every folder in your hierarchy. I'd recommend a different version control system that creates one dot folder at the top of your hierarchy like Git or Mercurial. On Thu, Aug 27, 2009 at 5:04 PM, Alexander Hartner wrote: > For some time now I hav

Alert dialog in agent app?

2009-08-27 Thread Gabriel Zachmann
My Cocoa application has the plist flag "application is background only" set. (I believe, this is the former LSUIElement property.) Now I would like to display an alert dialog. Unfortunately, this does not work; it even seems it makes the application hang. The code for the alert box looks

Subversion and Interface Builder

2009-08-27 Thread Alexander Hartner
For some time now I have been struggling with interface builder's NIB files and subversion. Every time I localise the .svn folder seem to be removed or get broken in other ways. I had a look online and found the suggestion below. Since this link is a little dated I am wondering if there are

Re: CALayer drawing delay

2009-08-27 Thread David Duncan
On Aug 27, 2009, at 3:28 PM, Ivy Feraco wrote: in the method I use CGImage to draw .png bitmaps of numerals that count up from 0. The .pngs all have transparency. Everything works, the counter changes count, but as it changes you can see a slight transition between the two digits. It almost

ScriptingBridge error message

2009-08-27 Thread Gabriel Zachmann
When my code executes this line ppt_ = [[SBApplication applicationWithBundleIdentifier:@"com.microsoft.Powerpoint"] retain]; then I get the following output on the console: MyApp: unknown type name "constant". MyApp: unknown type name "null". Does anyone have an idea, what

CALayer drawing delay

2009-08-27 Thread Ivy Feraco
I am using CALayers and a delegate to provide content with the method - (void)drawLayer:(CALayer *)theLayer inContext:(CGContextRef)theContext in the method I use CGImage to draw .png bitmaps of numerals that count up from 0. The .pngs all have transparency. Everything works, the co

Re: debugging a 64 bit app

2009-08-27 Thread Sean McBride
On 8/27/09 2:23 PM, kvic...@pobox.com said: >with a 32 bit app, when i hit a breakpoint in gdb, i could select a >stack frame and enter the following into the gdb console: > > (gdb) po *(int *)($ebp+) > >where was 8 to see the receiver of the message, 16 to see the >first "meaningful" param

Re: debugging a 64 bit app

2009-08-27 Thread Nick Zitzmann
On Aug 27, 2009, at 3:23 PM, kvic...@pobox.com wrote: what is the proper way to see stack parameters with cocoa 64 bit apps with gdb? If you're developing for X86-64, you really ought to read the part about calling conventions. Basically, unle

debugging a 64 bit app

2009-08-27 Thread kvic...@pobox.com
with a 32 bit app, when i hit a breakpoint in gdb, i could select a stack frame and enter the following into the gdb console: (gdb) po *(int *)($ebp+) where was 8 to see the receiver of the message, 16 to see the first "meaningful" parameter, etc. however, i'm not building a 64 bit

Re: Making failed NSAsserts crash an app

2009-08-27 Thread Keith Duncan
They do not, check that, should not become less true just because your app is built release vs debug. Strictly speaking I believe you're more accurately describing an invariant than an assertion. Not all error states are fatal states. Assert happens when entering an error state, and is left

Re: Making NSNumberFormatter empty-tolerant

2009-08-27 Thread Frédéric Testuz
Le 27 août 09 à 21:46, bryscomat a écrit : Interesting. Is that documented anywhere? That's why I was confused as to exactly how I got mine to work. Seems like a fluke... On Aug 27, 2009, at 2:39 PM, Frédéric Testuz wrote: I had the same problem. For the 10.4 behaviour of NSNumberFormatte

Re: Making failed NSAsserts crash an app

2009-08-27 Thread Kyle Sluder
On Thu, Aug 27, 2009 at 12:29 PM, Ed Wynne wrote: > This attitude is, at best, a perversion of the very definition of an > assertion. Assertions are things that must be true, that is why they are > assertions. They do not, check that, should not become less true just > because your app is built rel

Launching a document-based app with no document

2009-08-27 Thread Dylan McNamee
Which hook should I use to detect that my document-based app has been launched without a document having been dropped on it (or double- clicked upon)? Right now my app just launches and shows its menu. What I'd like to do is catch this case, and at least pop up an "Open" dialog. I tried c

Re: Making NSNumberFormatter empty-tolerant

2009-08-27 Thread bryscomat
Interesting. Is that documented anywhere? That's why I was confused as to exactly how I got mine to work. Seems like a fluke... On Aug 27, 2009, at 2:39 PM, Frédéric Testuz wrote: Le 27 août 09 à 20:45, Markus Spoettl a écrit : Hello, before I get to the question this is my setup: 1) NSTe

Re: Making NSNumberFormatter empty-tolerant

2009-08-27 Thread Frédéric Testuz
Le 27 août 09 à 20:45, Markus Spoettl a écrit : Hello, before I get to the question this is my setup: 1) NSTextField ("field") 2) bound to an NSNumber property ("number") of an object. 3) "field" has an NSNumberFormatter attached with all default values (as set up by IB), except maximum fra

Fwd: Reasons why QL would fail to create thumbnail?

2009-08-27 Thread David Blanton
Begin forwarded message: From: David Blanton Date: August 27, 2009 1:32:30 PM MDT To: Keith Duncan Subject: Re: Reasons why QL would fail to create thumbnail? A QLGenerator On Aug 27, 2009, at 1:12 PM, Keith Duncan wrote: QLThumbnailImageCreate function is returning nil So why would it

Re: Making failed NSAsserts crash an app

2009-08-27 Thread Ed Wynne
On Aug 27, 2009, at 3:12 PM, Kyle Sluder wrote: On Thu, Aug 27, 2009 at 9:46 AM, Squ Aire wrote: However, do you have any idea how to accomplish what I actually want to do? Is my original idea of forcing asserts to crash maybe bad, which is why noone even thought of suggesting a way to do it

Re: Starting editing for a Row as soon as it is Added.

2009-08-27 Thread Sean McBride
On 8/27/09 4:42 PM, Joshua Garnham said: >I have an NSOutlineView and what I want to happen is that when a row is >added I want the row that has been added to Start Editing immediately >like when you double click on a row. @implementation NSTableView (RRExtra) - (void)makeEditableSelectedCellOfC

Re: Reasons why QL would fail to create thumbnail?

2009-08-27 Thread Keith Duncan
QLThumbnailImageCreate function is returning nil So why would it fail in a few percent of cases, but mostly work? All affected users are running the latest system version. What is your preview being generated from, a QuickLook generator or the Preview and Thumbnail files in your bundle's Q

Re: Making failed NSAsserts crash an app

2009-08-27 Thread Kyle Sluder
On Thu, Aug 27, 2009 at 9:46 AM, Squ Aire wrote: > However, do you have any idea how to accomplish what I actually want to do? > Is my original idea of forcing asserts to crash maybe bad, which is why noone > even thought of suggesting a way to do it? It's a bad idea. Assertions should be optim

Re: Making NSNumberFormatter empty-tolerant

2009-08-27 Thread bryscomat
I solved this before by putting a single space in the Null Placeholder spot on the bindings panel in IB. It worked for me. On Aug 27, 2009, at 1:45 PM, Markus Spoettl wrote: Hello, before I get to the question this is my setup: 1) NSTextField ("field") 2) bound to an NSNumber property ("nu

Making NSNumberFormatter empty-tolerant

2009-08-27 Thread Markus Spoettl
Hello, before I get to the question this is my setup: 1) NSTextField ("field") 2) bound to an NSNumber property ("number") of an object. 3) "field" has an NSNumberFormatter attached with all default values (as set up by IB), except maximum fraction digits is set to 1. 4) "number" can be

Fwd: Reasons why QL would fail to create thumbnail?

2009-08-27 Thread David Blanton
Begin forwarded message: From: David Blanton Date: August 27, 2009 9:42:45 AM MDT To: Graham Cox Subject: Re: Reasons why QL would fail to create thumbnail? One of my customers reported last week that our QL Generator suddenly quit working. Today the customer reported that after running

Re: NSTableView's delegate dataCellForTableColumn never called

2009-08-27 Thread Donnie Lee
Thanks Corbin, now I fully understand. Donnie. On Thu, Aug 27, 2009 at 8:41 PM, Corbin Dunn wrote: > Donnie - the problem is, people can run FireFox on 10.4, where the method > doesn't exist, and hence it wouldn't work. > > If you rebuild Firefox to target 10.5 or higher, then the method will be

Re: Reasons why QL would fail to create thumbnail?

2009-08-27 Thread Quincey Morris
On Aug 27, 2009, at 04:34, Graham Cox wrote: I'm using the following code to generate thumbnail images in one of my user interfaces. It works fine on my machine, and on all the ones I've tested, but a couple of users have reported that they don't see the thumbnails. One user experiencing th

RE: Making failed NSAsserts crash an app

2009-08-27 Thread Squ Aire
Thank you both for the info so far. However, do you have any idea how to accomplish what I actually want to do? Is my original idea of forcing asserts to crash maybe bad, which is why noone even thought of suggesting a way to do it? How do people normally do it? Do they just make a crash repor

Starting editing for a Row as soon as it is Added.

2009-08-27 Thread Joshua Garnham
I have an NSOutlineView and what I want to happen is that when a row is added I want the row that has been added to Start Editing immediately like when you double click on a row. Cheers, Josh. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: NSTableView's delegate dataCellForTableColumn never called

2009-08-27 Thread Corbin Dunn
Donnie - the problem is, people can run FireFox on 10.4, where the method doesn't exist, and hence it wouldn't work. If you rebuild Firefox to target 10.5 or higher, then the method will be called. --corbin On Aug 27, 2009, at 9:39 AM, Donnie Lee wrote: Hi Corbin, Do you mean that the

Re: NSTableView's delegate dataCellForTableColumn never called

2009-08-27 Thread Donnie Lee
Hi Corbin, Do you mean that the problem is in Firefox? Have you any ideas how to workaround this? Donnie. On Thu, Aug 27, 2009 at 8:34 PM, Corbin Dunn wrote: > The method only works for applications that link against 10.5 or higher. The > said app probably doesn't link against 10.5 > > -corbin >

Re: NSTableView's delegate dataCellForTableColumn never called

2009-08-27 Thread Corbin Dunn
The method only works for applications that link against 10.5 or higher. The said app probably doesn't link against 10.5 -corbin On Aug 27, 2009, at 8:08 AM, Donnie Lee wrote: Hello! I have a window with NSTableView in a bundle and load this bundle from dylib (which is a XPCOM component for

Re: NSOperationQueue emptying

2009-08-27 Thread Adam R. Maxwell
On Aug 27, 2009, at 8:18 AM, McLaughlin, Michael P. wrote: I'm wondering about the timing of NSOperationQueue emptying. In my Objective-C++ (Leopard) app, I have one opQueue of operations and the very last thing each operation does is enqueue the results of a computation back to the main

NSFile and NSTask

2009-08-27 Thread Brent Smith
Hey all, Ive been trying to think of a good way around my current solution for displaying contents of a text file. Right now I basically run an NSTask on tail -f and that's about it. I plan on redoing this section of the code to allow the scroll view to go all the way back to the beginnin

Re: Xcode Analyze memory misunderstanding

2009-08-27 Thread Clark Cox
I would recommend renaming that method. Per Cocoa conventions, methods that start with "new" should return an object with an outstanding retain count like +alloc... and -copy do (among others). On Thu, Aug 27, 2009 at 3:29 AM, Reza Farhad wrote: > Dear all > > I am running my code through xcode "B

NSOperationQueue emptying

2009-08-27 Thread McLaughlin, Michael P.
I'm wondering about the timing of NSOperationQueue emptying. In my Objective-C++ (Leopard) app, I have one opQueue of operations and the very last thing each operation does is enqueue the results of a computation back to the main thread. NSPointerArray *ptr = [NSPointerArray pointerArrayWithStron

NSTableView's delegate dataCellForTableColumn never called

2009-08-27 Thread Donnie Lee
Hello! I have a window with NSTableView in a bundle and load this bundle from dylib (which is a XPCOM component for Firefox extension). But I have a big problem: dataCellForTableColumn delegate never called. All other delegates are called, but this -- not. When I try to load this bundle from simpl

Re: _subtreeDescription: What do the ampersands mean?

2009-08-27 Thread Ken Ferry
The ampersands are springs and the dashes are struts. [view autoresizingMask] is NSViewMaxXMargin|NSViewMinYMargin. -Ken On Wed, Aug 26, 2009 at 7:22 PM, Michael A. Crawford < michaelacrawf...@me.com> wrote: > In the line of GDB output below, what do the ampersands following the h= > and v= mea

Re: Best way to determine what ip address are assigned to a given network interface.

2009-08-27 Thread glenn andreas
On Aug 27, 2009, at 9:21 AM, Sherm Pendley wrote: On Thu, Aug 27, 2009 at 10:09 AM, Mark McCray wrote: I've seen a bunch of methods for getting a list of ip addresses that a machine may have. But i haven't seen a Cocoa way of figuring out what ip address is attached to a given interface.

Re: Best way to determine what ip address are assigned to a given network interface.

2009-08-27 Thread Sherm Pendley
On Thu, Aug 27, 2009 at 10:09 AM, Mark McCray wrote: > I've seen a bunch of methods for getting a list of ip addresses that a > machine may have. But i haven't seen a Cocoa way of figuring out what > ip address is attached to a given interface.  NSHost give's you IPs > but which network interfaces

Re: Two controllers in a window, how do I get one to run a function in another?

2009-08-27 Thread bryscomat
The solution I'd recommend is in Cocoa Bindings. http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/CocoaBindings.html A view controller per view is a good idea. For some more samples on that, you can look at KTUIKit. http://katidev.com/blog/ktuikit/ I'd written something

Re: Two controllers in a window, how do I get one to run a function in another?

2009-08-27 Thread Sherm Pendley
On Thu, Aug 27, 2009 at 10:04 AM, Graham Cox wrote: > > On 27/08/2009, at 11:55 PM, Support wrote: > >> I want to have two NSObjects (controllers) - one for the tableview and all >> the actions that it needs to perform, and one for the web view.  I am having >> difficulty getting the tableview cont

Best way to determine what ip address are assigned to a given network interface.

2009-08-27 Thread Mark McCray
Hello, I've seen a bunch of methods for getting a list of ip addresses that a machine may have. But i haven't seen a Cocoa way of figuring out what ip address is attached to a given interface.  NSHost give's you IPs but which network interfaces those IPs are attached to. Can this be done with the

Re: Two controllers in a window, how do I get one to run a function in another?

2009-08-27 Thread Graham Cox
On 27/08/2009, at 11:55 PM, Support wrote: I want to have two NSObjects (controllers) - one for the tableview and all the actions that it needs to perform, and one for the web view. I am having difficulty getting the tableview controller to tell the webview controller to display a particu

Two controllers in a window, how do I get one to run a function in another?

2009-08-27 Thread Support
I'm writing an application which has one window, with an NSTableView and a WebView in it. The NSTableView will contain a list of URLs and site descriptions and the WebView will display the URL when it's clicked on in the NSTableView. So far, so simple - especially if the NSTableView and WebVie

Re: Reasons why QL would fail to create thumbnail?

2009-08-27 Thread jonat...@mugginsoft.com
On 27 Aug 2009, at 12:34, Graham Cox wrote: I'm using the following code to generate thumbnail images in one of my user interfaces. It works fine on my machine, and on all the ones I've tested, but a couple of users have reported that they don't see the thumbnails. One user experiencing th

Re: Reasons why QL would fail to create thumbnail?

2009-08-27 Thread Julien Jalon
Might be interesting to ask your user to use qlmanage -t on the file to see if anything relevant appears here. Also what kind of file is it? Maybe the user has some plugin installed there. On Thursday, August 27, 2009, Graham Cox wrote: > I'm using the following code to generate thumbnail images

Temporarily disabling all input events while non-blocking animations are playing

2009-08-27 Thread Oleg Krupnov
Hi, I'd like my app to block while an animation is playing. Normally, I would simply use a blocking animation, but now I have two short animations playing simultaneously, so I have to make them both non-blocking. How do I block the app in this case? Basically I'd like to prevent the user from (ina

Re: Using Core Data NSManagedObject subclasses outside of a managed object context

2009-08-27 Thread Mike Abdullah
Further to earlier answers, reread the docs on -[NSManagedObject initWithEntity:managedObjectContext:] There's nothing to stop you doing this: NSManagedObject *object = [[NSManagedObject alloc] initWithEntity:entity managedObjectContext:nil]; [object setFoo:bar]; as long as you supply a va

Reasons why QL would fail to create thumbnail?

2009-08-27 Thread Graham Cox
I'm using the following code to generate thumbnail images in one of my user interfaces. It works fine on my machine, and on all the ones I've tested, but a couple of users have reported that they don't see the thumbnails. One user experiencing this problem helped me to log some results whic

Re: Xcode Analyze memory misunderstanding

2009-08-27 Thread Jonathan del Strother
On Thu, Aug 27, 2009 at 11:29 AM, Reza Farhad wrote: > Dear all > > I am running my code through xcode "Build and Analyze" to check for bugs. > I have the function below which gives me the following error: > > Object with +0 retain counts returned to caller where a +1 (owning) retain > count is exp

Xcode Analyze memory misunderstanding

2009-08-27 Thread Reza Farhad
Dear all I am running my code through xcode "Build and Analyze" to check for bugs. I have the function below which gives me the following error: Object with +0 retain counts returned to caller where a +1 (owning) retain count is expected I can not understand why can anybody enlighten me.

Re: NSSplitView resizing

2009-08-27 Thread Bill Cheeseman
On Aug 26, 2009, at 11:55 PM, Oftenwrong Soong wrote: n this app my needs are very limited (for now at least!) so I implemented a simple delegate method. Everyone's input helped tremendously. Thanks to everyone who posted: - (void)splitView:(NSSplitView *)sender resizeSubviewsWithOldSize:

Re: How to Convert "#FF00FF" String Specifying RGB Color to 32 bit int

2009-08-27 Thread Peter Zegelin
Sorry Graham - I should have mentioned that the color is rgba within the uint32. Thanks everyone - Robs solution worked great, though I'll have to strip off the # first and then shift to the left a further 8 bits. Never used NSScanner before but its a good solution. On 27/08/2009, at 9:50