release static pointers

2009-01-26 Thread Christian Giordano
Hi guys, I'm using sqlite3 library and a common technique is to cache the statement. In some examples I found the statement is set as static in the model which gets instantiated lazily. I'm wondering if and how the pointer to the statement will be released. In the code samples I saw there is no

Location of the standard Apple icons in IB

2009-01-26 Thread Florian Soenens
Hi list, i'm working on a 10.4+ app and i use some icon templates like NSPreferencesGeneral, NSUser, etc... The problem is that something like [toolbarItem setImage:[NSImage imageNamed:@NSPreferencesGeneral]] only works on 10.5+ My question is, does anyone know the location these icons on

Re: Location of the standard Apple icons in IB

2009-01-26 Thread Florian Soenens
You're right! Don't know why i didn't think about that myself... ;-) Txs. On 26 Jan 2009, at 11:37, Jean-Daniel Dupas wrote: Le 26 janv. 09 à 11:29, Florian Soenens a écrit : Hi list, i'm working on a 10.4+ app and i use some icon templates like NSPreferencesGeneral, NSUser, etc... The

Re: Getting iPod icon, was Getting the network Machine Icon

2009-01-26 Thread Dave
Opps! I sent this by mistake, I already found the solution this weekend, I just changed the BitmapInfo to kCGImageAlphaPremulitipledFirst and all is well! Thanks a lot for your help, it's almost all working now. All the Best Dave Hi Jean, Thanks, I added the code you suggested and it

How to catch and log EXC_BAD_ACCESS?

2009-01-26 Thread Oleg Krupnov
For the beta-testing purposes, I'd like my app to handle the situation when the EXC_BAD_ACCESS exception occurs, and treat it gracefully - i.e. send a crash report and perhaps terminate. Currently, the app just hangs and needs the user to send Force Quit to terminate the app. I tried to wrap the

Re: How to catch and log EXC_BAD_ACCESS?

2009-01-26 Thread jonat...@mugginsoft.com
On 26 Jan 2009, at 11:33, Oleg Krupnov wrote: For the beta-testing purposes, I'd like my app to handle the situation when the EXC_BAD_ACCESS exception occurs, and treat it gracefully - i.e. send a crash report and perhaps terminate. Currently, the app just hangs and needs the user to send

RE: Creating a managed object without adding it to the context?

2009-01-26 Thread Ulai Beekam
My problem is that when I add directly to the managed object context, the item is not getting selected automatically in the array controller (by the way, I see the selection visually by means of the table view bound to the array controller) even if I have checked the select on insert

Full screen on a display other than the main display

2009-01-26 Thread Matias Piipari
I tried making my application work in full screen with the method I've attached below. This however only works correctly on the main display -- if I try triggering this when the main window is any other screen I get just black on that screen. What am I doing wrong? - (IBAction)

Re: Opening Symbolic Links

2009-01-26 Thread René v Amerongen
On 26 jan 2009, at 07:07, Gerriet M. Denkmann wrote: Am I doing something wrong? nop Does anybody seen this strange behaviour as well, or is it only me? Not only you. Wii have the same behaviour. Even when you try to open it in textedit it doesn't work. The links doesn't know what the

Configuring a Port-based Input Source -- Part 2

2009-01-26 Thread John Love
[continuation -- part 2] Here is where my mainCtrl parm comes into play, because instead of Apple's: Within my do { [[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; } while (![mainCtrl shouldExit]); where my – (BOOL) shouldExit is in my

Re: Accessing private members of another object of the same class

2009-01-26 Thread Horst Jäger
First of all: thank you. You solved my problem. There's no real way to enforce privateness, either in Objective-C or C++. Why not in C++? Yes, these do the trick. But another-mineAlone will. -(int)yoursTooButWithAnother: (PrivateClass *)another { return

Re: release static pointers

2009-01-26 Thread Peter Blazejewicz
hi Christian, On Jan 26, 2009, at 11:25 AM, Christian Giordano wrote: I'm wondering if and how the pointer to the statement will be released. In the code samples I saw there is no trace of the releasing (in this case, sqlite3_finalize(statement)). This is the example:

Re: Accessing private members of another object of the same class

2009-01-26 Thread Jeremy Pereira
On 26 Jan 2009, at 14:02, Horst Jäger wrote: First of all: thank you. You solved my problem. There's no real way to enforce privateness, either in Objective-C or C++. Why not in C++? #define private public class Foo { private: int privateVar; } ;

Re: Accessing private members of another object of the same class

2009-01-26 Thread Jean-Daniel Dupas
Le 26 janv. 09 à 15:02, Horst Jäger a écrit : First of all: thank you. You solved my problem. There's no real way to enforce privateness, either in Objective-C or C++. Why not in C++? And why not in Obj-C ? The new runtime (64 bits, non-fragile) declare a symbol for each ivar.

Re: release static pointers

2009-01-26 Thread Christian Giordano
It looked like a good tutorial :) Thanks, I'll check better the Apple way. Cheers, chr On Mon, Jan 26, 2009 at 1:59 PM, Peter Blazejewicz peter.blazejew...@gmail.com wrote: hi Christian, On Jan 26, 2009, at 11:25 AM, Christian Giordano wrote: I'm wondering if and how the pointer to the

Configuring a Port-based Input Source -- Part 1

2009-01-26 Thread John Love
I have this request for help in two parts, because I've been bumped due to length: Reference: Configuring a Port-Based Input Source of http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/RunLoopManagement/chapter_6_section_5.html#/ /apple_ref/doc/uid/1057i-CH16-SW7

Binding Buttons and Popup Menus to NSDictionary made from a prefs plist?

2009-01-26 Thread Robert Monaghan
Hi Everyone, I am trying to wrap my head around using a plist. Everything that I have seen on the mailing list so far, involves using an NSTableView to work with NSDictionaries. Here is what I have set up. I have several NSButtons and pre-populated NSPopup Buttons, where the index values or

Re: Accessing private members of another object of the same class

2009-01-26 Thread glenn andreas
On Jan 26, 2009, at 8:14 AM, Jean-Daniel Dupas wrote: There's no real way to enforce privateness, either in Objective-C or C++. Why not in C++? And why not in Obj-C ? The new runtime (64 bits, non-fragile) declare a symbol for each ivar. Private ivars are not exported by default, so

Re: Targeting Tiger

2009-01-26 Thread David Springer
Hi John, Also worth noting: you can build on Leopard with Xcode 3.x, using the 10.4 SDK, and your app might run fine on a Leopard box. BUT, you still need to test on a native Tiger platform because the systems dylibs are different (and yes, the 10.4 API behaves differently between Tiger and

Re: Accessing private members of another object of the same class

2009-01-26 Thread Bill Bumgarner
On Jan 26, 2009, at 7:24 AM, glenn andreas wrote: The layout for 64 bit new runtime objects is not defined (and due to the non-fragile part, isn't even fixed at compile or link time, so you'd have to munge your way through undocumented data structures - better off just using KVC). Or the

Re: Knowing when a NSArrayController is ready

2009-01-26 Thread Ashley Clark
On Jan 26, 2009, at 10:58 AM, Sean McBride wrote: On 1/24/09 11:05 PM, jonat...@mugginsoft.com said: I changed my store type to SQLite and noted an immediate improvement in load times. Your app isn't garbage collected is it? Because if so, note that the SQL store is incompatible with GC

Re: How to catch and log EXC_BAD_ACCESS?

2009-01-26 Thread Scott Ribe
Currently, the app just hangs and needs the user to send Force Quit to terminate the app. You sure about that? It can take a while to prepare the crash report, and during that time your app is certainly non-responsive. But that signal causes the system to terminate your application, and I have

autorelease problem

2009-01-26 Thread Nick Rogers
Hi, My program is crashing when releasing the NSAutoreleasePool. I have in my code: - (void)MyFunction { while (count) { NSAutoreleasePool *innerloop = [[NSAutoreleasePool alloc] init]; HDIR *dir = [someArray objectAtIndex:count]; NSString

Re: How to catch and log EXC_BAD_ACCESS?

2009-01-26 Thread Kyle Sluder
On Mon, Jan 26, 2009 at 7:16 AM, jonat...@mugginsoft.com jonat...@mugginsoft.com wrote: EXC_BAD_ACCESS is not an application exception it is a Unix signal. Signals are a BIG topic. EXC_BAD_ACCESS is not a UNIX signal, it is a Mach exception. In response to this exception, the UNIX layer will

Re: Knowing when a NSArrayController is ready

2009-01-26 Thread Sean McBride
On 1/26/09 11:06 AM, Ashley Clark said: Your app isn't garbage collected is it? Because if so, note that the SQL store is incompatible with GC apps. :( What's this supposed incompatibility? According to everything I've read CoreData is fully GC compliant. I would assume that includes all of

Re: autorelease problem

2009-01-26 Thread Matt Gough
On 26 Jan 2009, at 18:12, Nick Rogers wrote: - (NSString*)suggestedRepeatFileName:(NSString *)fileName inDir: (HDIR *)dir { // some code here NSString *fileNameReturned = [NSString stringWithFormat:@%@, someString]; return fileNameReturned; } Is there any problem with the

Re: Knowing when a NSArrayController is ready

2009-01-26 Thread Nick Zitzmann
On Jan 26, 2009, at 12:18 PM, Sean McBride wrote: You assume incorrectly: http://www.cocoabuilder.com/archive/message/cocoa/2008/2/28/200078 That's only if the program is using the NSPersistentDocument API. I've been using a CoreData sqlite app that doesn't use NSPersistentDocument and

Re: autorelease problem

2009-01-26 Thread Nick Rogers
hi, thanks for the reply. someString in the method suggestedRepeat... is an NSMutableString allocated and initialized within that method. -[HDIR setFileName] is as follows: - (void)setFileName:(NSString *)name { name = [name copy]; [fileName release]; fileName =

Re: autorelease problem

2009-01-26 Thread Shawn Erickson
On Mon, Jan 26, 2009 at 9:40 AM, Nick Rogers roger...@mac.com wrote: hi, thanks for the reply. someString in the method suggestedRepeat... is an NSMutableString allocated and initialized within that method. How is it allocated? Please show that code. What about someDir? -

NSTextField line breaking

2009-01-26 Thread John Nairn
In a nib file I can set line breaking mode of an NSTextField (e.g., clip, truncate front, middle, end, etc.). But, I cannot find and way to make that setting in a programmatically created NSTextField. I looked through NSTextField, NSTextFieldCell, and NSControl. John Nairn

Re: NSTextField line breaking

2009-01-26 Thread John Nairn
In a nib file I can set line breaking mode of an NSTextField (e.g., clip, truncate front, middle, end, etc.). But, I cannot find and way to make that setting in a programmatically created NSTextField. I looked through NSTextField, NSTextFieldCell, and NSControl. I just found it in NSCell

Re: NSTextField line breaking

2009-01-26 Thread Jonathan Hess
Hey John - Here are the methods you're looking for: - (void)setWraps:(BOOL)flag; - (void)setScrollable:(BOOL)flag; - (void)setScrollable:(BOOL)flag; They're from NSCell. Good Luck - Jon Hess On Jan 26, 2009, at 9:53 AM, John Nairn wrote: In a nib file I can set line breaking mode of an

Re: Knowing when a NSArrayController is ready

2009-01-26 Thread Sean McBride
On 1/26/09 10:29 AM, Nick Zitzmann said: http://www.cocoabuilder.com/archive/message/cocoa/2008/2/28/200078 That's only if the program is using the NSPersistentDocument API. I've been using a CoreData sqlite app that doesn't use NSPersistentDocument and uses GC, and it works just fine. True

Re: Creating a managed object without adding it to the context?

2009-01-26 Thread Sean McBride
On 1/26/09 12:21 PM, Ulai Beekam said: IIRC that happens when you insert the object directly into the managed object context without going through the array controller. I.e. by using NSManagedObject's -initWithEntity:insertIntoManagedObjectContext: instead of NSArrayController's

get the drawing text height

2009-01-26 Thread David Alter
I'm drawing a string to screen and I want to get the height if I specify a specific width. I'm drawing the string by using the NSString drawInRect: withAttributes:. I do not see how I can get the height after the text has wrapped. I have looked at NSString sizeWithAttributes, but there does not

Re: Core Data performance [Re: Knowing when a NSArrayController is ready]

2009-01-26 Thread jonathan
On 25 Jan 2009, at 21:30, Ben Trumbull wrote: The results for a default fetch on a data set of 1500 very simple objects are: XML - usesLazyFetching = NO 38.00 sec load XML - usesLazyFetching = YES 4.78 sec load SQLite - usesLazyFetching = NO 35.25 sec load SQLite - usesLazyFetching = YES

Re: get the drawing text height

2009-01-26 Thread Nick Zitzmann
On Jan 26, 2009, at 11:45 AM, David Alter wrote: I'm drawing a string to screen and I want to get the height if I specify a specific width. I'm drawing the string by using the NSString drawInRect: withAttributes:. I do not see how I can get the height after the text has wrapped. I have

Safari-like tabs in my own app?

2009-01-26 Thread Ulai Beekam
Where can I get Safari-like tabs in my own app? Actually, drag and drop is not necessary for me, but I need tabs that merge themselves into the toolbar. For instance, judging from this image: http://www.xtorrentp2p.com/1.png does he use some known tab implementation? Let's just say I want

Re: Accessing private members of another object of the same class

2009-01-26 Thread Scott Ribe
Why not in C++? Same as Objective-C, another instance of the same class can access them (as can static methods of the class)... -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list

Adding rows in NSPredicateEditor

2009-01-26 Thread Tom
Hi everyone, I'm wondering if there is a way I can control which row template gets added when the user clicks the '+' button on an NSPredicateEditor. The template chosen seems to be random, but I want it to be a specific one for user convenience. Kind regards, Tom

Managing user focus

2009-01-26 Thread Sergey Uspensky
Hello! Im porting an application to Leopard written in Qt - kinda onscreen keyboard. The thing is I need to make MainWindow of the application not accepting keyboard focus (user focus) when user clicks on it choosing possible letters (keep it always inactivated). So when user has chosen the

Re: Safari-like tabs in my own app?

2009-01-26 Thread Dave DeLong
Check out PSMTabBarControl over on googlecode: http://code.google.com/p/maccode/wiki/WhatIsMacCode Dave On Jan 26, 2009, at 12:50 PM, Ulai Beekam wrote: Where can I get Safari-like tabs in my own app? Actually, drag and drop is not necessary for me, but I need tabs that merge themselves

Re: get the drawing text height

2009-01-26 Thread James Walker
David Alter wrote: I'm drawing a string to screen and I want to get the height if I specify a specific width. I'm drawing the string by using the NSString drawInRect: withAttributes:. I do not see how I can get the height after the text has wrapped. I have looked at NSString sizeWithAttributes,

Re: Adding rows in NSPredicateEditor

2009-01-26 Thread Peter Ammon
On Jan 25, 2009, at 3:25 AM, Tom wrote: Hi everyone, I'm wondering if there is a way I can control which row template gets added when the user clicks the '+' button on an NSPredicateEditor. The template chosen seems to be random, but I want it to be a specific one for user convenience.

Re: Core Data performance [Re: Knowing when a NSArrayController is ready]

2009-01-26 Thread Ben Trumbull
On Jan 26, 2009, at 11:47 AM, jonat...@mugginsoft.com wrote: Why ? Put Shark in Time Sample (All Threads State). You'll get close to wall clock time with a sampling accuracy of microseconds. 36000 years later... I'm not that old. For short events like launch time, I've found Shark to

Setting data cell type for a specific row

2009-01-26 Thread kentozier
Hi I have a table where I want a button field in the last row of a column to contain a different button cell than all the other rows. All rows before the last contain a delete button, but in the last row, I want to change that to an add button. I create the add button when my class in

[MEET] Sydney (Australia) - CocoaHeads February 5th

2009-01-26 Thread Mark Aufflick
Sydney CocoaHeads meets on the FIRST Thursday of each month and is meeting next Thursday, February 5th. We will be meeting at UTS Broadway, in room CB02.03.17 which means building 2, level 3, room 17 : Map: http://www.uts.edu.au/about/mapsdirections/bway.html If you get lost, I will try to be

Re: Setting data cell type for a specific row

2009-01-26 Thread I. Savant
On Mon, Jan 26, 2009 at 4:41 PM, kentoz...@comcast.net wrote: I have a table where I want a button field in the last row of a column to contain a different button cell than all the other rows. All rows before the last contain a delete button, but in the last row, I want to change that to

Re: CALayer autoresizing behaviour

2009-01-26 Thread Michael A. Crawford
Joe, I don't see you setting the needDisplayOnBoundsChange property, thus: layer.needDisplayOnBoundsChange = YES; The default value for this property is NO. -Michael -- We know as much about software quality problems as they knew about the Black Plague in the 1600s.

RE: Safari-like tabs in my own app?

2009-01-26 Thread Ulai Beekam
Check out PSMTabBarControl over on googlecode: http://code.google.com/p/maccode/wiki/WhatIsMacCode Dave Hmm ok. I checked that out but the palette refused to appear in Interface Builder. I followed their directions and put PSMTabBarControl.palette folder into ~/Library/Palettes/ folder

Re: Core Data performance [Re: Knowing when a NSArrayController is ready]

2009-01-26 Thread Ben Trumbull
On Jan 26, 2009, at 2:09 PM, jonat...@mugginsoft.com wrote: The docs do state (Core Data Guide - Faults and KVO Notifications) that KVO notifications do occur as faults are realised, even if the faulted relationship is already in the moc (is this last assumption correct?) I'm not sure

Re: Safari-like tabs in my own app?

2009-01-26 Thread Nick Zitzmann
On Jan 26, 2009, at 3:17 PM, Ulai Beekam wrote: Hmm ok. I checked that out but the palette refused to appear in Interface Builder. I followed their directions and put PSMTabBarControl.palette folder into ~/Library/Palettes/ folder but no palettes appears in Inteface Builder even after

Re: Properties and memory management with overrides.

2009-01-26 Thread Sean McBride
On 1/18/09 4:29 PM, Ben Trumbull said: I mention this because (I'm embarrassed to admit) I never really thought about this till yesterday. I *think* other design decisions have made the atomic-ness irrelevant to any of the code I've written, but now I need to go back and check, especially

RE: Safari-like tabs in my own app?

2009-01-26 Thread john
Hi Ulai- All of the palette instructions are for Interface Builder 2 - the new IB3 has a different plug-in architecture. You will have to use the framework and a custom view in IB with the more modern tools (until someone crafts up an IB3 plugin :-) It does have the merge behavior you seek,

A question about key equivalents for menu items

2009-01-26 Thread Slava Pestov
Hi all, Is there a nice way to get a Unicode string from a keyboard shortcut, that looks like the key equivalents in NSMenuItems, for rendering elsewhere in a GUI? Slava ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: Cocoa-dev Digest, Vol 6, Issue 154

2009-01-26 Thread Michael Robinson
Greetings List, A month ago my main hard disk failed, and I lost some development files that were not backed up. Yes I know I am stupid. Unfortunately the disk is too damaged for any recovery. I have the latest version of the project I was working on, but it is in a compiled, releasable

Re: A question about key equivalents for menu items

2009-01-26 Thread Peter Ammon
On Jan 26, 2009, at 2:57 PM, Slava Pestov wrote: Hi all, Is there a nice way to get a Unicode string from a keyboard shortcut, that looks like the key equivalents in NSMenuItems, for rendering elsewhere in a GUI? Slava Hey Slava, No such function, unfortunately. You can roll your own

Re: A question about key equivalents for menu items

2009-01-26 Thread I. Savant
On Jan 26, 2009, at 6:19 PM, Peter Ammon wrote: No such function, unfortunately. You can roll your own with the Unicode characters for the modifier keys (0x2303, 0x2325, 0x21E7, 0x2318 for control, option, shift, and command), though there's still some special cased glyphs, like space.

Re: Properties and memory management with overrides.

2009-01-26 Thread Quincey Morris
On Jan 26, 2009, at 14:45, Sean McBride wrote: On 1/18/09 4:29 PM, Ben Trumbull said: I mention this because (I'm embarrassed to admit) I never really thought about this till yesterday. I *think* other design decisions have made the atomic-ness irrelevant to any of the code I've written,

Re: Setting data cell type for a specific row

2009-01-26 Thread kentozier
I. Savant: You don't get a reference to a cell. You tell the table view (via a delegate method) what prototype cell to use for the requested col/row. See:  -[NSTableView tableView:dataCellForTableColumn:row:] I took a look at that but it really seems to complicate things. Basically, I

Re: Properties and memory management with overrides.

2009-01-26 Thread Bill Bumgarner
On Jan 26, 2009, at 4:00 PM, Quincey Morris wrote: Although the rationale for non-atomicity runs under the general thread-safety discussion umbrella, there are actually two separate issues to consider. It helps to explicitly *not* think about atomicity under the same umbrella as thread

Re: Setting data cell type for a specific row

2009-01-26 Thread I. Savant
On Jan 26, 2009, at 7:45 PM, I. Savant wrote: Well what did you expect it to do? Again ... you don't get a reference to an individual cell at a row/ column. Tables don't work that way in Cocoa. The cell for a column is a *prototype* cell that's reused (changed and re-rendered in the

ass/ssa support

2009-01-26 Thread Ariel Rodriguez
Does anybody knows if there are some cocoa library to parse ass/ssa files? I know libass, but as far as i can see, it have a few memory leaks (and since i am planning to work with Cocoa Touch, i am really concerned about memory leaks). Thanks and best regards. Ariel Rodriguez,

CoreData silently failing to insert?

2009-01-26 Thread Nick Zitzmann
I've got another CoreData problem, and this one is quite strange. In this case, I have an entity that subclasses an abstract entity, and for some very strange reason I cannot diagnose, it will only save managed objects in that entity if the properties have very specific values in them.

Re: Properties and memory management with overrides.

2009-01-26 Thread Quincey Morris
On Jan 26, 2009, at 16:26, Bill Bumgarner wrote: However, even if only one thread can be changing the data, atomicity still matters. If the accessors aren't atomic, multiple read-only users of the data (in different threads) might get completely bogus results. This problem *can* be solved

Re: Not Resolving Aliases

2009-01-26 Thread Gerriet M. Denkmann
On 27 Jan 2009, at 07:39, Scott Ribe wrote: What are you actually trying to do? I was trying to send the path of a symbolic link (not the content of this link, which anyway might not exist) to another app. This other app displays all sort of information or metadata about this path.

Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare

2009-01-26 Thread Adam Venturella
Here is what I am doing now.. I just feel like I have an extra step in converting the buffer into NSData...malloc...free uint sample = 0x04034b50; uint8_t buffer[sizeof(uint)]; [inputStream open]; [inputStream read: buffer maxLength:sizeof(buffer)]; NSData * d = [NSData

Re: Not Resolving Aliases

2009-01-26 Thread Scott Ribe
I have given up on NSWorkspace, LaunchServices and now send the path via Distributed Objects. Hey, that surprises me ;-) Give what you said, my next attempt would have been constructing an open Apple Event... (Don't know if it would work, because I don't know when the normal resolution of

Re: CoreData silently failing to insert?

2009-01-26 Thread Jerry Krinock
On 2009 Jan 26, at 17:08, Nick Zitzmann wrote: ...saving does not cause the NSManagedObjectContext to return an error. ...MOC returning no errors upon save... Make sure you're looking at the YES/NO return value of - [NSManagedObjectContext save:] and not just the non-nil-ness of the

NSTextView.preferredPasteboardTypeFromArray

2009-01-26 Thread Chris Idou
I'm trying to make an NSTextView do something rational when someone drags a token from an NSTokenField. So I've got the NSTokenField producing a custom drag type I've called TokenPboardType. I've inherited from NSTextView and redefined readablePasteboardTypes to be: -

Re: How to catch and log EXC_BAD_ACCESS?

2009-01-26 Thread Michael Ash
On Mon, Jan 26, 2009 at 12:09 PM, Scott Ribe scott_r...@killerbytes.com wrote: Currently, the app just hangs and needs the user to send Force Quit to terminate the app. You sure about that? It can take a while to prepare the crash report, and during that time your app is certainly

Re: Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare

2009-01-26 Thread Graham Cox
On 27 Jan 2009, at 2:09 pm, Adam Venturella wrote: NSData * d = [NSData dataWithBytes:buffer length:sizeof(buffer)]; uint * key = (uint *) malloc(sizeof(uint)); [d getBytes:key length:sizeof(uint)]; uint key; [d getBytes:key length:sizeof(uint)]; but since you have merely wrapped buffer

Re: Core Data performance [Re: Knowing when a NSArrayController is ready]

2009-01-26 Thread Dave Fernandes
I don't mean to hijack this thread, but I have had a related (?) problem where a transient String attribute is derived from a persistent Binary attributed (an archived NSAttributedString). When my NSTableView sorts on this column, and I modify a managed object displayed in the table, I get

Re: CoreData silently failing to insert?

2009-01-26 Thread Nick Zitzmann
On Jan 26, 2009, at 9:34 PM, Jerry Krinock wrote: Make sure you're looking at the YES/NO return value of - [NSManagedObjectContext save:] and not just the non-nil-ness of the NSError returned by reference. I'm doing that, too. It still returns YES even though the records were not

Re: How to catch and log EXC_BAD_ACCESS?

2009-01-26 Thread Slava Pestov
On Mon, Jan 26, 2009 at 10:43 PM, Michael Ash michael@gmail.com wrote: Actually it's pretty easy to avoid exiting due to EXC_BAD_ACCESS, just install a signal handler for SIGSEGV. In my experience, setting a handler for SIGSEGV is problematic because the crash reporter still starts up, so

Re: Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare

2009-01-26 Thread Adam Venturella
Thanks! I knew I was doing to many steps! On Mon, Jan 26, 2009 at 8:44 PM, Graham Cox graham@bigpond.com wrote: On 27 Jan 2009, at 2:09 pm, Adam Venturella wrote: NSData * d = [NSData dataWithBytes:buffer length:sizeof(buffer)]; uint * key = (uint *) malloc(sizeof(uint)); [d

Re: Core Data performance [Re: Knowing when a NSArrayController is ready]

2009-01-26 Thread Ben Trumbull
poor hijacked thread. You cannot ask -executeFetchRequest: to either filter (by predicate) or sort (by sort descriptor) based on a transient or unmodeled property. The table view and array controller can happily sort or filter in memory. Performance on sorting large data sets in memory

Re: Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare

2009-01-26 Thread Graham Cox
On 27 Jan 2009, at 4:17 pm, Adam Venturella wrote: Thanks! I knew I was doing to many steps! uint key = *(uint*)buffer; You will also need to consider byte-ordering if your app or the data could be used on different architectures. If for example your input data is known to be

Re: How to catch and log EXC_BAD_ACCESS?

2009-01-26 Thread Bill Bumgarner
On Jan 26, 2009, at 8:43 PM, Michael Ash wrote: Actually it's pretty easy to avoid exiting due to EXC_BAD_ACCESS, just install a signal handler for SIGSEGV. Of course, doing something rational in such a signal handler is ever so slightly non-trivial. Hahahaha yeah. That is an

Re: Setting data cell type for a specific row

2009-01-26 Thread Ken Tozier
On Jan 26, 2009, at 7:45 PM, I. Savant wrote: ... sorry? How does implementing one delegate method that's directly targeted at the very problem you're trying to solve complicate things? I was confused about what to return from the method if I just wanted the data cell preserved as is.

Re: Not Resolving Aliases

2009-01-26 Thread Gerriet M. Denkmann
On 27 Jan 2009, at 11:05, Scott Ribe wrote: I have given up on NSWorkspace, LaunchServices and now send the path via Distributed Objects. Hey, that surprises me ;-) Give what you said, my next attempt would have been constructing an open Apple Event... (Don't know if it would work,