KVC Question

2008-10-10 Thread Joseph Crawford
Hello, To give a bit of a background what I am doing is writing an application that will query the whitepages.com web api. I have all the XML parsing done so that it parses all the results into a results array that I am trying to use for my table data source. I am trying to set this up

Re: [NSApp stop:]

2008-10-10 Thread Michiel de Hoon
--- On Fri, 10/10/08, Jason Coco [EMAIL PROTECTED] wrote: Is there a reason you want to stop the application event loop? I want to use Cocoa in an extension module to Python. When Python is not doing anything, I am runnning Cocoa's event loop. I let the event loop listen for input on stdin

Re: Strategy for naming support folder

2008-10-10 Thread Kyle Sluder
On Fri, Oct 10, 2008 at 1:15 AM, Graham Cox [EMAIL PROTECTED] wrote: I think I'll do it this way unless I hear some good arguments against. The user might have very legitimate reason to play with things in ~/Library/Application Support. As such, I'd hesitate to confuse the user with weird

Re: Strategy for naming support folder

2008-10-10 Thread j o a r
On Oct 9, 2008, at 11:16 PM, Kyle Sluder wrote: The user might have very legitimate reason to play with things in ~/Library/Application Support. As such, I'd hesitate to confuse the user with weird names. In the worst case, the user might delete the folder in confusion. Your app's bundle

Re: Strategy for naming support folder

2008-10-10 Thread Rob Keniger
On 10/10/2008, at 4:36 PM, j o a r wrote: The same thing could be said about preference files too though, and they're stored using the bundle identifier per default. The name is also not as stable as the bundle identifier. The name of the app could, for example, be localized in the

Re: Strategy for naming support folder

2008-10-10 Thread Kyle Sluder
On Fri, Oct 10, 2008 at 2:36 AM, j o a r [EMAIL PROTECTED] wrote: The same thing could be said about preference files too though, and they're stored using the bundle identifier per default. Preference files are opaque; the user's interaction with preference files should be (ideally) through the

Re: Strategy for naming support folder

2008-10-10 Thread j o a r
On Oct 10, 2008, at 12:02 AM, Rob Keniger wrote: This might be true but I have a lot of apps installed (more than 250, not counting the Apple pre-installed apps) and the count of those that use a bundle identifier as the name of their folder in the ~/Library/Application Support folder is

Re: Strategy for naming support folder

2008-10-10 Thread Graham Cox
On 10 Oct 2008, at 6:06 pm, Kyle Sluder wrote: You're going to be hardcoding the name of the folder anyway, whether that hardcoding happens to be in the form of a string in your source code or the CFBundleIdentifier in your Info.plist. Why needlessly inconvenience the user when you derive no

Re: How do I debug this?

2008-10-10 Thread Ashley Clark
Stack trace: #00x92badc66 in -[NSException raise] #10x901c3283 in -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] #20x901a0122 in AppKitMenuEventHandler #30x90c79303 in DispatchEventToHandlers #40x90c7873d in SendEventToEventTargetInternal #5

appscript installation

2008-10-10 Thread John Love
I've downloaded appscript. I do not know if the appscript folder must be placed in a precise spot, so I just placed it where I wanted to. Maybe it should be in the Developer folder?? Since objc-appscript is based on py-appscript, I have typed sudo easy_install appscript in Terminal and

Re: Key filtering in the NSSavePanel?

2008-10-10 Thread Fritz Anderson
On 10 Oct 2008, at 7:15 AM, Bob Stuller wrote: I have a need to restrict filenames coming out of a NSSavePanel. Is there anyway to hook in there vet the keystrokes? Not at the keystroke level, and that's a tricky level to work at; the usual philosophy on text fields is to stay out of the

Re: Finder Crashes on File Open

2008-10-10 Thread Negm-Awad Amin
Am Do,09.10.2008 um 19:47 schrieb Brian Miller: Hi All, I have a Cocoa Core Data Document based application. When files created with this application are opened via the Finder (or double clicked), the Finder crashes and restarts every time. Opening files from within the application

Re: KVC Question

2008-10-10 Thread Nathan Kinsinger
On Oct 9, 2008, at 8:04 PM, Joseph Crawford wrote: The issue I am running into is that when I run a search only the first row in the table view is populated with data from my results array. I am thinking this is because the valueForKey method is not passed the row index so it does not

Re: __memcpy crash with [NSData -getBytes:range:]

2008-10-10 Thread Clark Cox
On Fri, Oct 10, 2008 at 2:48 AM, Daniel Kennett [EMAIL PROTECTED] wrote: Hi list, I'm having trouble reproducing (and fixing) a rare bug that I sometimes get reports about. Here's the code that causes the crash. streamPosition and length are checked to make sure they're within the range of

Re: How do I debug this?

2008-10-10 Thread Jens Miltner
Am 10.10.2008 um 07:13 schrieb Graham Cox: Stack trace: #0 0x92badc66 in -[NSException raise] #1 0x901c3283 in -[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:] #2 0x901a0122 in AppKitMenuEventHandler #3 0x90c79303 in DispatchEventToHandlers #4 0x90c7873d

__memcpy crash with [NSData -getBytes:range:]

2008-10-10 Thread Daniel Kennett
Hi list, I'm having trouble reproducing (and fixing) a rare bug that I sometimes get reports about. Here's the code that causes the crash. streamPosition and length are checked to make sure they're within the range of the NSData object: // Allocate a buffer. void *buffer =

Re: __memcpy crash with [NSData -getBytes:range:]

2008-10-10 Thread Matt Gough
On 10 Oct 2008, at 11:48, Daniel Kennett wrote: // Allocate a buffer. void *buffer = malloc(length); // Fill the buffer with the requested bytes. [_data getBytes:buffer range:NSMakeRange(streamPosition, length)]; Are you sure that buffer has actually been created? Maybe you are

Key filtering in the NSSavePanel?

2008-10-10 Thread Bob Stuller
Folks, Greetings! I have a need to restrict filenames coming out of a NSSavePanel. Is there anyway to hook in there vet the keystrokes? Peace, Bob As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging

Fwd: Finder Crashes on File Open

2008-10-10 Thread Shawn Erickson
Oops missed the list... On Thu, Oct 9, 2008 at 10:47 AM, Brian Miller [EMAIL PROTECTED] wrote: Hi All, I have a Cocoa Core Data Document based application. When files created with this application are opened via the Finder (or double clicked), the Finder crashes and restarts every time.

Re: NSCoding protocol

2008-10-10 Thread Negm-Awad Amin
Am Fr,03.10.2008 um 21:00 schrieb [EMAIL PROTECTED]: I want MyClass to conform to the NSCoding protocol. But I'm puzzled about how to implement the initWithCoder: method. Suppose I have this in MyClass.h: NSString *S1, *S2, *S3; and this in its init function: S1 = @a

CalendarStore sync failure

2008-10-10 Thread Dale Jensen
I'm trying to get iCal syncing going, and have followed the instructions given in the CalendarStore documentation right along, but I'm getting this thrown when I try to add an event: 2008-10-10 11:12:53.349 iCalExternalSync[30033:10b] SyncServices precondition failure in

Re: Multithreaded Core Data app design

2008-10-10 Thread Ron Lue-Sang
On Oct 9, 2008, at 2:44 AM, Ruotger Skupin wrote: Hi, Since Ron asked, let's move this to an own thread (no pun intended): Am 08.10.2008 um 18:23 schrieb Ron Lue-Sang: Hi, I have a core data database with two contexts attached to it. One read-only for the main thread and bindings, one

Re: Strategy for naming support folder

2008-10-10 Thread Kyle Sluder
On Fri, Oct 10, 2008 at 3:27 AM, j o a r [EMAIL PROTECTED] wrote: Can you give a concrete example? I would argue that you're doing something wrong if you ask your user to muck around in ~/Library. There are better ways of solving the plugin problem - as demonstrated by both System Preferences

Re: NSCoding protocol

2008-10-10 Thread Clark Cox
On Fri, Oct 10, 2008 at 9:09 AM, Negm-Awad Amin [EMAIL PROTECTED] wrote: Am Fr,03.10.2008 um 21:00 schrieb [EMAIL PROTECTED]: I want MyClass to conform to the NSCoding protocol. But I'm puzzled about how to implement the initWithCoder: method. Suppose I have this in MyClass.h:

inconsistent float behaviour

2008-10-10 Thread Steven Hamilton
Hi folks, I think I need some help understanding floats. I have a class that calculates a balance and places it in a table column. At the end of this method I NSLog the output like so; NSLog(@current balance is: %@,balance); and get current balance is: 18976.69 in the console. So far so

Re: NSCoding protocol

2008-10-10 Thread Negm-Awad Amin
Am Fr,10.10.2008 um 18:17 schrieb Clark Cox: On Fri, Oct 10, 2008 at 9:09 AM, Negm-Awad Amin [EMAIL PROTECTED] wrote: Am Fr,03.10.2008 um 21:00 schrieb [EMAIL PROTECTED]: I want MyClass to conform to the NSCoding protocol. But I'm puzzled about how to implement the initWithCoder:

Re: CalendarStore sync failure

2008-10-10 Thread Nick Zitzmann
On Oct 10, 2008, at 10:19 AM, Dale Jensen wrote: This comes up whether I've an alarm attached to the event or not. The event does get added, but I would like to clear up what's happening here. Any ideas? Thanks! It looks like your local sync state is somehow wedged. Try hitting the

Re: inconsistent float behaviour

2008-10-10 Thread Dave Carrigan
On Oct 10, 2008, at 4:04 AM, Steven Hamilton wrote: Hi folks, I think I need some help understanding floats. I have a class that calculates a balance and places it in a table column. At the end of this method I NSLog the output like so; NSLog(@current balance is: %@,balance); and get

Re: inconsistent float behaviour

2008-10-10 Thread Nick Zitzmann
On Oct 10, 2008, at 5:04 AM, Steven Hamilton wrote: Am I totally misunderstanding something about floats? Or is the extra ##'s in the formatter making things up? Floating point values of either float or double are not guaranteed to be super precise, and should never be used to represent

Re: Strategy for naming support folder

2008-10-10 Thread Quincey Morris
On Oct 10, 2008, at 00:31, Graham Cox wrote: I do tend to agree that it's not a place users should be visiting routinely, and the app itself should offer an interface where necessary to manage its own stuff in there. As with prefs, odds are that the only time a user will ever go in there

Re: inconsistent float behaviour

2008-10-10 Thread Gary L. Wade
I've not used it myself, but there is also NSDecimal that may be an alternative. Also, I recall seeing an IBM-released class that I believe had been part of ICU that also did decimal arithmetic using 32 or 64 bits. On Oct 10, 2008, at 5:04 AM, Steven Hamilton wrote: Am I totally

Re: inconsistent float behaviour

2008-10-10 Thread Michael Ash
On Fri, Oct 10, 2008 at 7:04 AM, Steven Hamilton [EMAIL PROTECTED] wrote: The float calculation is exactly 2 decimal places This is unlikely. There are very few numbers with two decimal places which can be perfectly represented in floating-point numbers. (Those would be numbers with fractional

Re: Finder Crashes on File Open

2008-10-10 Thread Brian Miller
Hi, Here is the plist, thanks in advance for taking a look at it: ?xml version=1.0 encoding=UTF-8? !DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd plist version=1.0 dict keyCFBundleDevelopmentRegion/key stringEnglish/string

Re: inconsistent float behaviour

2008-10-10 Thread ghe
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Nick Zitzmann wrote: On Oct 10, 2008, at 5:04 AM, Steven Hamilton wrote: Am I totally misunderstanding something about floats? Or is the extra ##'s in the formatter making things up? Floating point values of either float or double are not

Re: Strategy for naming support folder

2008-10-10 Thread Uli Kusterer
On 10.10.2008, at 07:15, Graham Cox wrote: On 10 Oct 2008, at 11:30 am, j o a r wrote: Most apps use just the name, but I've never liked that and I support your idea of using the bundle identifier. Makes a lot of sense. Yep, seemed to make sense to me too, but I don't think I've ever

Re: inconsistent float behaviour

2008-10-10 Thread Uli Kusterer
On 10.10.2008, at 13:04, Steven Hamilton wrote: NSLog(@current balance is: %@,balance); and get current balance is: 18976.69 in the console. So far so good. (...) The float calculation is exactly 2 decimal places, I know that for a fact and NSLog proves it. You may want to be aware that

Re: CalendarStore sync failure

2008-10-10 Thread Dale Jensen
On Oct 10, 2008, at 11:52 AM, Nick Zitzmann wrote: On Oct 10, 2008, at 10:19 AM, Dale Jensen wrote: This comes up whether I've an alarm attached to the event or not. The event does get added, but I would like to clear up what's happening here. Any ideas? Thanks! It looks like your

Re: Strategy for naming support folder

2008-10-10 Thread Ricky Sharp
On Friday, October 10, 2008, at 01:04PM, Uli Kusterer [EMAIL PROTECTED] wrote: On 10.10.2008, at 07:15, Graham Cox wrote: On 10 Oct 2008, at 11:30 am, j o a r wrote: Most apps use just the name, but I've never liked that and I support your idea of using the bundle identifier. Makes a lot

CATextLayers text alignment?

2008-10-10 Thread Tim Andersson
Hi there. I'm using a CATextLayer to display some text which the user can change the font size of. When the user changes the font size, I still want my text to be centered, both vertically and horizontally. As far as I know you can only set the the CATextLayers alignmentMode to

NSNull and @

2008-10-10 Thread DKJ
I've made an NSDictionary where the values are strings. Is there a difference between setting a value as [NSNull null] and setting it as @? (I've been using the former.) dkj ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: NSNull and @

2008-10-10 Thread Seth Willits
On Oct 10, 2008, at 3:20 PM, DKJ wrote: I've made an NSDictionary where the values are strings. Is there a difference between setting a value as [NSNull null] and setting it as @? (I've been using the former.) Is there a difference? Definitely. One is an instance of NSString, the other

Re: NSNull and @

2008-10-10 Thread Colin Barrett
On Fri, Oct 10, 2008 at 3:20 PM, DKJ [EMAIL PROTECTED] wrote: I've made an NSDictionary where the values are strings. Is there a difference between setting a value as [NSNull null] and setting it as @? (I've been using the former.) It's up to you. Unlike other languages, Cocoa dictionaries are

Re: NSNull and @

2008-10-10 Thread Shawn Erickson
On Fri, Oct 10, 2008 at 5:11 PM, Colin Barrett [EMAIL PROTECTED] wrote: It is up to the caller of objectForKey: (which returns id) to check the type of the returned object and make sure it is what you are expecting it to be. To go further... it isn't important what the type is are run time,

Re: NSNull and @

2008-10-10 Thread Ian Joyner
On 11/10/2008, at 9:33 AM, Seth Willits wrote: On Oct 10, 2008, at 3:20 PM, DKJ wrote: I've made an NSDictionary where the values are strings. Is there a difference between setting a value as [NSNull null] and setting it as @? (I've been using the former.) Is there a difference?

Re: NSNull and @

2008-10-10 Thread Seth Willits
On Oct 10, 2008, at 5:40 PM, Ian Joyner wrote: I'm just trying to work out what NSNull really is in the Cocoa context. Is it an object in Cocoa? As I said, yes. It's truly an object. (A singleton, as well.) Since NSNull may be a valid value of any other type, is it counted as a subtype

Re: NSNull and @

2008-10-10 Thread Kyle Sluder
On Fri, Oct 10, 2008 at 8:40 PM, Ian Joyner [EMAIL PROTECTED] wrote: I'm just trying to work out what NSNull really is in the Cocoa context. Is it an object in Cocoa? I think (from other environments) that it is a type signifying no object. Since NSNull may be a valid value of any other type,

Re: inconsistent float behaviour

2008-10-10 Thread Steven Hamilton
Thanks guys, I'm still unsure why I'm getting 4 decimal places as I know for fact that the data is 2 decimal places. However, it seems my approach is wrong. I'll convert to int's and NSDecimalNumbers instead and remove all floats. On 11/10/2008, at 4:14 AM, Uli Kusterer wrote: On

Re: inconsistent float behaviour

2008-10-10 Thread Kyle Sluder
On Fri, Oct 10, 2008 at 9:33 PM, Steven Hamilton [EMAIL PROTECTED] wrote: I'm still unsure why I'm getting 4 decimal places as I know for fact that the data is 2 decimal places. However, it seems my approach is wrong. I'll convert to int's and NSDecimalNumbers instead and remove all floats.

Re: inconsistent float behaviour

2008-10-10 Thread Kyle Sluder
On Fri, Oct 10, 2008 at 9:58 PM, Kyle Sluder [EMAIL PROTECTED] wrote: This article It would help if I provided the link. http://www.setfiremedia.com/blog/7-top-tips-for-coding-with-currency ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: inconsistent float behaviour

2008-10-10 Thread Clark Cox
On Fri, Oct 10, 2008 at 6:33 PM, Steven Hamilton [EMAIL PROTECTED] wrote: Thanks guys, I'm still unsure why I'm getting 4 decimal places as I know for fact that the data is 2 decimal places. That is because floating point numbers don't have decimal places; forget all about decimal places.

Re: NSNull and @

2008-10-10 Thread Ian Joyner
On 11/10/2008, at 11:58 AM, Seth Willits wrote: On Oct 10, 2008, at 5:40 PM, Ian Joyner wrote: I'm just trying to work out what NSNull really is in the Cocoa context. Is it an object in Cocoa? As I said, yes. It's truly an object. (A singleton, as well.) Since NSNull may be a valid

Re: NSNull and @

2008-10-10 Thread Ian Joyner
On 11/10/2008, at 12:31 PM, Kyle Sluder wrote: On Fri, Oct 10, 2008 at 8:40 PM, Ian Joyner [EMAIL PROTECTED] wrote: I'm just trying to work out what NSNull really is in the Cocoa context. Is it an object in Cocoa? I think (from other environments) that it is a type signifying no object.

Re: NSNull and @

2008-10-10 Thread Kyle Sluder
On Fri, Oct 10, 2008 at 10:33 PM, Ian Joyner [EMAIL PROTECTED] wrote: So we must be dependent on testing, which I find compelling like agile programming, but ultimately very hit and miss. Luckily the Developer Tools come with the OCUnit unit testing framework. If it's a strong type system you

NSTableView and drag and drop

2008-10-10 Thread Chris Idou
I want to be able to drag strings out of a table into another field, but I must be missing something major because drags never get initiated. I've added the delegate, registered drag types and added delegate methods, but clicking and dragging within the table simply selects rows in the table,

Re: NSPersistentDocument No Support Save To (Save As?)

2008-10-10 Thread Jerry Krinock
On 2008 Oct, 09, at 2:27, chaitanya pandit wrote: On 09-Oct-08, at 2:52 AM, Mike Abdullah wrote: But why? NSPersistentDocument provides this automatically for you. It's only Save To that's not supported. Or is there a good reason to provide a custom implementation that I'm missing?

Re: NSNull and @

2008-10-10 Thread Ian Joyner
On 11/10/2008, at 2:18 PM, Kyle Sluder wrote: On Fri, Oct 10, 2008 at 10:33 PM, Ian Joyner [EMAIL PROTECTED] wrote: So we must be dependent on testing, which I find compelling like agile programming, but ultimately very hit and miss. Luckily the Developer Tools come with the OCUnit unit

Re: Strategy for naming support folder

2008-10-10 Thread Graham Cox
On 11 Oct 2008, at 5:30 am, Ricky Sharp wrote: Along with being readable, all my customers can easily back up everything from my company (since all files ultimate resides in that Instant Interactive folder). Or, they can choose individual nested folders in case they have different backup

Re: How do I debug this? [SOLVED]

2008-10-10 Thread Graham Cox
Thanks to everyone who responded - I found the problem. Though I had breakpoints set on [NSException raise], by the time the breakpoint was hit there was nothing on the stack trace from my code. Breaking on objc_exception_throw didn't work either (that's called even later). However by

Opening a document from stationery

2008-10-10 Thread Graham Cox
I want to implement opening a document from stationery. This opens a new 'untitled' document but preloaded with the content from the template file. It's pretty much working using the following code: NSDocument* newDoc = [[NSDocumentController sharedDocumentController]

Add animation layer and then remove animation layer

2008-10-10 Thread Steven Riggs
I'm enabling a core animation when I replace a subview and I want the animation layer to go away when the transition is finished so I don't have the blinky window resizing and other fun fade effects that I don't want. I have a problem with my code. The first time I changeRightView the

Re: How can be my application notified about user defaults changes?

2008-10-10 Thread Steven Riggs
Alexander, If you have a bunch of keys in your defaults, try only observing the specific key. Like this... - (void)awakeFromNib { //setup key observer here [[NSUserDefaults standardUserDefaults] addObserver:self