Re: UI tool kit gone in IB 3?

2008-05-10 Thread Jonathan Hess
Hey Patrick - I'm not sure I understand your problem, but it sounds like you're looking for the palette from IB 2.0. If so, it's been replaced with "The Library". You can access the library from the "Tools" menu or with the key equivalent of command+shift+L. Good Luck - Jon Hess On May 1

Re: Core Data: How to Observe "dirty" State?

2008-05-10 Thread Dave Fernandes
Actually, the docs say that you can't do this. On May 10, 2008, at 9:54 PM, Chris Hanson wrote: On May 10, 2008, at 12:03 PM, Dave Fernandes wrote: You can also register for the NSManagedObjectContextObjectsDidChangeNotification to get a notification when anything in the MOC changes. Presu

Re: Cocoa coding style (was Re: Did I reinvent the wheel?)

2008-05-10 Thread Ilan Volow
Not that I know the original poster's development situation, but for those of us writing client-server multi-user enterprise database Cocoa apps, there's really no Apple-provided solution right now; running SQLLite and Core Data on a local machine isn't going to cut it. Even if Apple were t

UI tool kit gone in IB 3?

2008-05-10 Thread Patrick J. Collins
Hi, I am just curious, using Interface Builder 3 for the first time... Am I missing something or is the tool kit for all of the window items (text field, text view, button, slider, etc) gone??? Can anyone walk me through how I can manually add these items to a window if the UI toolkit is no long

Re: Cocoa coding style (was Re: Did I reinvent the wheel?)

2008-05-10 Thread Jens Alfke
On 10 May '08, at 7:29 PM, Western Botanicals wrote: The reason for using the singleton method was to ensure that I never have more than one cache or database access object. Having more than one cache or database access object could lead to having the same data pulled from the database int

Re: Cocoa coding style (was Re: Did I reinvent the wheel?)

2008-05-10 Thread Jens Alfke
On 10 May '08, at 6:53 PM, Chris Hanson wrote: Not necessarily. You can simply return a constant YES for a read- only "dirty" property, and treat the property-change itself as the trigger you care about. A "dirty" property that tells lies half the time doesn't sound like a good idea to m

Re: gathering system information

2008-05-10 Thread Jens Alfke
On 10 May '08, at 6:55 PM, Chris Hanson wrote: Every week or so, someone asks *exactly* this question. What is everyone doing with this information? I just want to know why everyone suddenly needs to parse XML and/or control other apps' windows. (Hm, maybe they're implementing botnets d

ID3 Album Art

2008-05-10 Thread Mr. Gecko
Hello I am using this ID3 Framework for cocoa http://drewfamily.homemail.com.au/Cocoa_-_ID3Tag_framework.html and I want to add an image from the web which is an jpeg. I have already tried this. TagAPI *MP3 = [[TagAPI alloc] initWithGenreList:nil]; [MP3 examineFile:MP3Path]; NSBitmapImageRep *im

Re: Cocoa coding style (was Re: Did I reinvent the wheel?)

2008-05-10 Thread Ilan Volow
Wouldn't an alternative to a "dirty" property for each object would be to do a Cocoa version of the Martin Fowler's Unit Of Work pattern (see http://martinfowler.com/eaaCatalog/unitOfWork.html) and every time there's a change observed that affects the dirty property, you'd register it as a "d

custom image unit not working when called from a Cocoa app

2008-05-10 Thread Josh Burnett
I've written a custom image unit and gotten it working satisfactorily in Core Image Fun House. However, when I go to add it to a filter chain in my Cocoa app, the filter chain stops working. It works fine without my custom filter added into the mix. Looks like I'm in a similar situation

Re: Cocoa coding style (was Re: Did I reinvent the wheel?)

2008-05-10 Thread Adam R. Maxwell
On May 10, 2008, at 8:12 PM, Michael Ash wrote: Even in this case, all you need to do is override -init to return the shared object. Apple's sample code, showing overrides to -retain, -release, and other such methods, just serves to hide bugs in the calling code. I'd agree with that; I think

Re: Cocoa coding style (was Re: Did I reinvent the wheel?)

2008-05-10 Thread Michael Ash
On Sat, May 10, 2008 at 10:14 PM, Jim Correia <[EMAIL PROTECTED]> wrote: > On May 10, 2008, at 1:43 AM, Chris Hanson wrote: > >> In general terms though, I'll still state that it's a bad idea to enforce >> that an object be a singleton — especially if you're new to the framework >> and memory manag

Re: wordRangeForRange implememtation

2008-05-10 Thread Ali Ozer
- (NSRange)wordRangeForRange:(NSRange)range{ NSString *string = [NSString stringWithString:[[self string] substringWithRange:range]]; Why do you make yet another copy of the string; you already have the substring? Maybe you meant to make a mutable copy? if([string hasPrefix:@" "

Re: wordRangeForRange implememtation

2008-05-10 Thread Ali Ozer
There are a number of problems in this code... - (NSRange)wordRangeForRange:(NSRange)range{ NSString *string = [NSString stringWithString:[[self string] substringWithRange:range]]; Why do you make yet another copy of the string; you already have the substring? Maybe you meant to make a m

Re: Cocoa coding style (was Re: Did I reinvent the wheel?)

2008-05-10 Thread Western Botanicals
Since the use of the singleton method has been a big issue, I'll post my reasonings for using it. Not that they are right, but I would like some comments on why I shouldn't use it for these reasons. 1. I used this page to implement the singleton method: http://developer.apple.com/documentatio

Re: Cocoa coding style (was Re: Did I reinvent the wheel?)

2008-05-10 Thread Jim Correia
On May 10, 2008, at 1:43 AM, Chris Hanson wrote: In general terms though, I'll still state that it's a bad idea to enforce that an object be a singleton — especially if you're new to the framework and memory management rules etc. Rather, I'd treat being a singleton as a code smell, and try

Re: gathering system information

2008-05-10 Thread Chris Hanson
On May 10, 2008, at 8:28 AM, Torsten Curdt wrote: Is there any other way of collection system information like - OS version - processor speed and architecture - RAM What do you need to collect this information for? Every week or so, someone asks *exactly* this question. What is everyone d

Re: Core Data: How to Observe "dirty" State?

2008-05-10 Thread Chris Hanson
On May 10, 2008, at 12:03 PM, Dave Fernandes wrote: You can also register for the NSManagedObjectContextObjectsDidChangeNotification to get a notification when anything in the MOC changes. Presumable you can then check [moc hasChanges], but I've never used that method. I would also expect

Re: Cocoa coding style (was Re: Did I reinvent the wheel?)

2008-05-10 Thread Chris Hanson
On May 10, 2008, at 11:40 AM, Jens Alfke wrote: On 9 May '08, at 7:41 PM, Chris Hanson wrote: (6) Leverage Cocoa framework features in your own code. For example, you don't need to have setter methods that invoke - setDirty:. You can just write a method like this - (NSSet *)keyPathsForV

Yann Disser Resizing NSTableView columns

2008-05-10 Thread Peter Hudson
sizeToFit simply sets the width of a column to the width of the header cell - and I suspect that you want to set the width of each column to suit the widest cell of data in that column. Here is the heuristic to achieve that: ( Assuming that you have not changed the font for any of the ce

Re: wordRangeForRange implememtation

2008-05-10 Thread Nathan Kinsinger
On May 10, 2008, at 2:26 PM, Lincoln Green wrote: - (NSRange)wordRangeForRange:(NSRange)range{ NSString *string = [NSString stringWithString:[[self string] substringWithRange:range]]; if([string hasPrefix:@" "]){ [string stringByReplacingCharactersInRange:NSMakeRange(0, 1) withS

Re: Anyone used btlsocket framework?

2008-05-10 Thread Ricky Sharp
On May 10, 2008, at 2:11 PM, Jens Alfke wrote: Anyone got a good socket framework to recommend? (I realize it's not that hard to roll your own with NSStreams, as shown in CocoaSockets, but a framework with a few more bells & whistles would be nice.) What about CFNetwork and friends?

Custom Value Transformer for PDFDocument data

2008-05-10 Thread Kevin Ross
Hello, I'm thinking of implementing a Custom Value Transformer to add PDFDocument support to a MangedObject. I just want to see if I'm on the right track or not. The code below works, I'm just not sure if this is the proper way to do this. Thanks for your feedback. @implementation PDFDat

set space for window

2008-05-10 Thread Mitchell Livingston
Hello, I have a window that, when closed, is not released because I want to save factors like layout, selected values, etc., but I want it, when opened, to be put in the current space since it is being "reopened". I cannot find a direct way to do this. Am I missing something or is there a

Re: gathering system information

2008-05-10 Thread Torsten Curdt
Is there any other way of collection system information like - OS version - processor speed and architecture - RAM other than calling system_profiler -xml > system.plist This was just asked a few days ago on the darwin-userlevel mailing list; search the archives for details. That poster wante

Re: gathering system information

2008-05-10 Thread Torsten Curdt
On May 10, 2008, at 18:12, Chilton Webb wrote: Hi Torsten, Apparently Gestalt is part of CoreServices (I thought it was Carbon). That will return a lot of info about the host system. I know processor speed, memory, and architecture are in there. See Gestalt.h for more info. Thanks, Chi

Re: Problem getting subclass of NSTextContainer working

2008-05-10 Thread Gordon Apple
One thing it doesn't do for you is keep track of the earlier rect heignts on the same line, as I showed at . You have to keep track of that yourself to keep it from overwriting itself on the next line. Here is part of my solution. Note that it still doesn't line up the baselines in the co

wordRangeForRange implememtation

2008-05-10 Thread Lincoln Green
- (NSRange)wordRangeForRange:(NSRange)range{ NSString *string = [NSString stringWithString:[[self string] substringWithRange:range]]; if([string hasPrefix:@" "]){ [string stringByReplacingCharactersInRange:NSMakeRange(0, 1) withString:@""]; range.location++;

Re: NSStream blocking behavior?

2008-05-10 Thread Michael Gardner
Responding to my own message here, but from looking at the CFWriteStreamWrite documentation, that function does have the semantics I was looking for (blocks until at least one byte has been written). I would assume that NSOutputStream's -write:maxLength: has the same behavior, though the do

Re: iChat theater

2008-05-10 Thread Chilton Webb
Hi Ben, I've been looking for the same answer for some time now. -Chilton On Saturday, May 10, 2008, at 01:49PM, "Ben Lachman" <[EMAIL PROTECTED]> wrote: >Hey everybody. Quick question; Does anyone know a way to start an >iChat theater session programatically? The IMAVManger needs to be in

Re: Anyone used btlsocket framework?

2008-05-10 Thread Michael Gardner
I've used SmallSockets (http://smallsockets.sourceforge.net/) in a small project, with good results. It doesn't do run loop events, but in my opinion it's better to just use threads with blocking I/O anyway. -Michael On May 10, 2008, at 2:11 PM, Jens Alfke wrote: On 10 May '08, at 11:59 A

Re: Anyone used btlsocket framework?

2008-05-10 Thread Robert Claeson
On 10 May 2008, at 21:11, Jens Alfke wrote: Anyone got a good socket framework to recommend? (I realize it's not that hard to roll your own with NSStreams, as shown in CocoaSockets, but a framework with a few more bells & whistles would be nice.) I haven't used it myself, but supposedly Om

Re: Anyone used btlsocket framework?

2008-05-10 Thread Jens Alfke
On 10 May '08, at 11:59 AM, Wade Tregaskis wrote: I haven't used it directly, but I did notice when looking at it that it seems to rely on you polling it... that's terrible, given you can setup a socket as a runloop source very easily and it operates very efficiently. By Jove, you're rig

Re: Core Data: How to Observe "dirty" State?

2008-05-10 Thread Dave Fernandes
You can also register for the NSManagedObjectContextObjectsDidChangeNotification to get a notification when anything in the MOC changes. Presumable you can then check [moc hasChanges], but I've never used that method. Dave On May 10, 2008, at 2:46 PM, Keary Suska wrote: Does anyone know

Re: Anyone used btlsocket framework?

2008-05-10 Thread Wade Tregaskis
btlsocket is a new open-source Cocoa framework that provides a high-level API for TCP and UDP sockets. On first glance it looks quite nice, definitely a step up compared to using NSStreams directly (a la the CocoaEcho sample.) But it's so new that I can

Re: Core Data: How to Observe "dirty" State?

2008-05-10 Thread I. Savant
Does anyone know how to "watch" for the dirty state of an NSManagedObjectContext (if that's where it is applicable)? I imagine the same way that NSPersistentDocument can do it, if that is feasible. NSManagedObjectContextObjectsDidChangeNotification http://developer.apple.com/documentation/Co

iChat theater

2008-05-10 Thread Ben Lachman
Hey everybody. Quick question; Does anyone know a way to start an iChat theater session programatically? The IMAVManger needs to be in IMAVRequested state, but seemingly there is no way for an app to request an session, the user actually has to select "share a file via iChat Theater" or w

Core Data: How to Observe "dirty" State?

2008-05-10 Thread Keary Suska
Does anyone know how to "watch" for the dirty state of an NSManagedObjectContext (if that's where it is applicable)? I imagine the same way that NSPersistentDocument can do it, if that is feasible. I know I can observe all of the properties in a managed object and set a flag when a change occurs (

Re: Cocoa coding style (was Re: Did I reinvent the wheel?)

2008-05-10 Thread Jens Alfke
On 9 May '08, at 7:41 PM, Chris Hanson wrote: (6) Leverage Cocoa framework features in your own code. For example, you don't need to have setter methods that invoke - setDirty:. You can just write a method like this - (NSSet *)keyPathsForValuesAffectingDirty { return [NSSet setWi

Re: gathering system information

2008-05-10 Thread Jens Alfke
On 10 May '08, at 8:28 AM, Torsten Curdt wrote: Is there any other way of collection system information like - OS version - processor speed and architecture - RAM other than calling system_profiler -xml > system.plist This was just asked a few days ago on the darwin-userlevel mailing list

Anyone used btlsocket framework?

2008-05-10 Thread Jens Alfke
btlsocket is a new open-source Cocoa framework that provides a high-level API for TCP and UDP sockets. On first glance it looks quite nice, definitely a step up compared to using NSStreams directly (a la the CocoaEcho sample.) But it's so new that I can

Re: gathering system information

2008-05-10 Thread Chilton Webb
Hi Torsten, Apparently Gestalt is part of CoreServices (I thought it was Carbon). That will return a lot of info about the host system. I know processor speed, memory, and architecture are in there. See Gestalt.h for more info. -Chilton ___ Cocoa-de

gathering system information

2008-05-10 Thread Torsten Curdt
Hey guys, Is there any other way of collection system information like - OS version - processor speed and architecture - RAM other than calling system_profiler -xml > system.plist system_profiler -detailLevel mini -xml > system.plist system_profiler SPHardwareDataType SPMemoryDataT

Re: Problem getting subclass of NSTextContainer working properly [SOLVED]

2008-05-10 Thread John Joyce
Graham, that would be very cool to have posted here! If nothing else, it will be in the archive for others who run into it. (I'm in agreement about the clarity of a large number of docs... there often seems to be a circular relationship of what you need to understand before being able to under

Resizing NSTableView columns

2008-05-10 Thread Yann Disser
How can I resize all but the last column of a NSTableView in order to fit its content perfectly? (I don't care about the resulting size of the last column) If I call sizeToFit on each but the last column, my columns end up not being wide enough. Do I have to set the minWidth of each column?

Re: Problem getting subclass of NSTextContainer working properly [SOLVED]

2008-05-10 Thread Graham Cox
Thanks Kyle, that seems to be the correct interpretation - my code is working great now. If anyone's interested in this, I can post the code here if requested. G. On 10 May 2008, at 4:57 pm, Graham Cox wrote: Ok, I understand what you're saying - I'll try a reimplementation based on tha

Re: Did I reinvent the wheel?

2008-05-10 Thread Uli Kusterer
Am 09.05.2008 um 22:34 schrieb Western Botanicals: That is wierd, because Xcode hasn't given me any warnings. Leaks are semantic errors, not syntax errors. Xcode can not validate your algorithm, it can only make sure that the commands in it are well- formed. Since memory allocation and dea

Re: Did I reinvent the wheel?

2008-05-10 Thread Stéphane Sudre
On May 9, 2008, at 10:34 PM, Western Botanicals wrote: [...] PS: I didn't look in detail at all your classes, but I did notice that the UUID methods in BusinessObject have leaks. That is wierd, because Xcode hasn't given me any warnings. There's no reason for Xcode to do this. You would

Re: Sort

2008-05-10 Thread norio
Chuck, Thanks for the help. Suppose that you have these 9 strings:0001,0002,0003,001,002,003,01,02,03. I'd like to sort them as 0001,001,01,0002,002,02,0003,003,03 as Finder. If you use one of the compare methods that allows you to supply options, NSNumericSearch will do what you want. How

Re: Cocoa coding style (was Re: Did I reinvent the wheel?)

2008-05-10 Thread Clark Cox
On Fri, May 9, 2008 at 7:41 PM, Chris Hanson <[EMAIL PROTECTED]> wrote: > On May 9, 2008, at 11:10 AM, Western Botanicals wrote: > > > (5) The Objective-C type is BOOL, not bool. The latter is a C++ type. A minor nit to pick: bool (aka _Bool) is not exclusive to C++(as of C99 it's a C type as wel