Re: Opinion on managed memory and garbage collection

2009-06-22 Thread Chris Idou
I've written a reasonably non-trivial app using GC and using a fairly wide range of APIs. I've found several GC bugs in the Apple frameworks, which naturally enough are pretty annoying (as all memory problems are), but I don't think the annoyance is still anywhere near that of having to write

Re: Opinion on managed memory and garbage collection

2009-06-22 Thread Graham Cox
On 23/06/2009, at 2:21 PM, Michael Ash wrote: Retain/release has a long history, is very well understood, and doesn't really require much mental (or typing) overhead once you know it. With GC you're much more like a test pilot at this stage in the game, especially since there are a lot of frame

Re: Opinion on managed memory and garbage collection

2009-06-22 Thread Quincey Morris
On Jun 22, 2009, at 21:21, Michael Ash wrote: IMO there are three major reasons to avoid GC at this point: Your reasons are clearly stated, rational, compelling ... and almost *entirely* anecdotal. That means what you say is a personal perspective -- and I'm pretty sure that you know that.

Re: Beginner Question Re: Memory Management

2009-06-22 Thread WT
On Jun 23, 2009, at 7:37 AM, Eric Hermanson wrote: UNFORTUNATELY, the iPhone Simulator does not support instance variable synthesis (at least it didn't in 2.x, maybe that changed in 3.0). I just tested that in the 3.0 simulator and it does NOT support ivar synthesis. Wagner ___

Re: Amount of Arguments per Method

2009-06-22 Thread WT
On Jun 23, 2009, at 7:45 AM, Scott Anguish wrote: There should be whitespace automatically generated between the necessary bits. There is "necessary" as far as the compiler is concerned and there is "necessary" as far as humans are concerned. The second isn't technically a necessity, and

Re: Problem with NSValueTransformer, NSTableView and NSAttributedString

2009-06-22 Thread Donnie Lee
Hello, > On Mon, Jun 22, 2009 at 9:12 PM, Jim Correia wrote: >> The documentation for the value binding of NSTableView says that NSString >> and NSNumber are the supported value types. > > I do not see where you're finding this.  The bindings documentation > says: "The object should be suitable fo

Re: Beginner Question Re: Memory Management

2009-06-22 Thread WT
On Jun 23, 2009, at 7:29 AM, Quincey Morris wrote: On Jun 22, 2009, at 21:31, WT wrote: So, to all beginners out there, whenever you define a property, remember always to refer to it, in its own class, by self.property - at least when setting its value. It may be ok (depending on what you

Re: Amount of Arguments per Method

2009-06-22 Thread Scott Anguish
There should be whitespace automatically generated between the necessary bits. If you'd rather see it the other way (and I can see an argument for that), hit up bugreporter or feedback. Devpubs listens, and our delivery team (the folks that take the XML and output it to the various format

Re: Beginner Question Re: Memory Management

2009-06-22 Thread Eric Hermanson
Objective-C 2.0 supports not only property getter/setter synthesis, but instance variable synthesis. This means that you do not even have to declare the instance variable. As long as the property is defined correctly, the instance variable (and the getter/setter) will be created for you

Re: Amount of Arguments per Method

2009-06-22 Thread Rob Ross
I actually had to use that method once in one of my very first Cocoa apps. My personal rule of thumb for my own code is, when a method I write has more than 3 parameters I start to suspect there's a more OO way of breaking up the problem. Huge argument lists indicate a procedural design,

Re: Problem with NSValueTransformer, NSTableView and NSAttributedString

2009-06-22 Thread Kyle Sluder
On Mon, Jun 22, 2009 at 9:12 PM, Jim Correia wrote: > The documentation for the value binding of NSTableView says that NSString > and NSNumber are the supported value types. I do not see where you're finding this. The bindings documentation says: "The object should be suitable for the passing to

Re: Beginner Question Re: Memory Management

2009-06-22 Thread Quincey Morris
On Jun 22, 2009, at 21:31, WT wrote: So, to all beginners out there, whenever you define a property, remember always to refer to it, in its own class, by self.property - at least when setting its value. It may be ok (depending on what you're doing) to refer to it simply by property when *ge

Re: Beginner Question Re: Memory Management

2009-06-22 Thread WT
On Jun 23, 2009, at 7:15 AM, Graham Cox wrote: On 23/06/2009, at 2:31 PM, WT wrote: [textFieldPreviousContent release]; textFieldPreviousContent = [textField.text retain]; This is not a safe pattern anyway (though it's not the same as the discussion you raised). In isolation, suppose that

Re: Beginner Question Re: Memory Management

2009-06-22 Thread Graham Cox
On 23/06/2009, at 2:31 PM, WT wrote: [textFieldPreviousContent release]; textFieldPreviousContent = [textField.text retain]; This is not a safe pattern anyway (though it's not the same as the discussion you raised). In isolation, suppose that the previous text and the current text are th

Re: Beginner Question Re: Memory Management

2009-06-22 Thread Ken Thomases
On Jun 22, 2009, at 3:39 PM, Daniel Torrey wrote: I'm looking at some sample iPhone code, and in the app delegate's applicationDidFinishLaunching method, I see // Set up the view controller MyViewController *aViewController = [[MyViewController alloc] initWithNibName:@"HelloWorld"

Re: Warnings suggest compiler confusion between 32 and 64 bit code.

2009-06-22 Thread Kyle Sluder
On Mon, Jun 22, 2009 at 9:01 PM, Michael Ash wrote: > I think you mean -Wshorten-64-to-32. -Wconversion warns you every time > a function call has the parameter passing altered by the presence of > the function's prototype, which is to say that it will warn you every > time you call any function (o

Re: Beginner Question Re: Memory Management

2009-06-22 Thread Henry McGilton (Boulevardier)
On Jun 22, 2009, at 1:39 PM, Daniel Torrey wrote: I'm looking at some sample iPhone code, and in the app delegate's applicationDidFinishLaunching method, I see // Set up the view controller MyViewController *aViewController = [[MyViewController alloc] initWithNibName:@"HelloWorld"

Re: Amount of Arguments per Method

2009-06-22 Thread Bill Bumgarner
Meh. I'd much rather see calls to methods that take many arguments broken up across a number of lines for three reasons (drawing the line at methods that take 4 or more arguments, for me): (0) I can scan any given line of the method invocation sub-expression and know that the aligned colon

Re: Opinion on managed memory and garbage collection

2009-06-22 Thread WT
On Jun 23, 2009, at 6:21 AM, Michael Ash wrote: Retain/release has a long history, is very well understood, and doesn't really require much mental (or typing) overhead once you know it. Even less of a mental/typing overhead if you make use of properties. Wagner ___

Re: Warnings suggest compiler confusion between 32 and 64 bit code.

2009-06-22 Thread Dave Carrigan
On Jun 22, 2009, at 9:01 PM, Michael Ash wrote: -Wconversion warns you every time a function call has the parameter passing altered by the presence of the function's prototype, which is to say that it will warn you every time you call any function (or method) which takes a char, unsigned char,

Re: Amount of Arguments per Method

2009-06-22 Thread WT
On Jun 23, 2009, at 6:03 AM, Michael Ash wrote: On Mon, Jun 22, 2009 at 7:46 PM, Paul M wrote: In documentation, stacking the arguments verticaly is of value. In actual code, I _always_ concatenate on to as few lines as necesary (tho' using double indentation for subsequent lines) as I fin

Re: Beginner Question Re: Memory Management

2009-06-22 Thread WT
On Jun 23, 2009, at 4:47 AM, Graham Cox wrote: On 23/06/2009, at 6:39 AM, Daniel Torrey wrote: I'm looking at some sample iPhone code, and in the app delegate's applicationDidFinishLaunching method, I see // Set up the view controller MyViewController *aViewController = [[MyViewCon

Re: Opinion on managed memory and garbage collection

2009-06-22 Thread Michael Ash
On Mon, Jun 22, 2009 at 10:58 AM, Phil Hystad wrote: > Being relatively new to Cocoa and Objective-C, what is the consensus on > using the new version 2.0 managed memory features (garbage collection). > > If you were writing a new Cocoa application from scratch, would garbage > collection be the pr

Re: Problem with NSValueTransformer, NSTableView and NSAttributedString

2009-06-22 Thread Jim Correia
On Jun 21, 2009, at 10:37 AM, Donnie Lee wrote: I created NSTableView and bind table column with NSTextFieldCell with custom NSValueTransformer subclass to NSArrayController. My value transformer should return NSAttributedString transformed from NSString. Everything works fine except that the ta

Re: Problem with NSValueTransformer, NSTableView and NSAttributedString

2009-06-22 Thread Michael Ash
On Mon, Jun 22, 2009 at 11:15 PM, Jerry Krinock wrote: > > On 2009 Jun 21, at 07:37, Donnie Lee wrote: > >> I created NSTableView and bind table column with NSTextFieldCell with >> custom NSValueTransformer subclass to NSArrayController. My value >> transformer should return NSAttributedString tran

Re: Amount of Arguments per Method

2009-06-22 Thread Michael Ash
On Mon, Jun 22, 2009 at 7:46 PM, Paul M wrote: > In documentation, stacking the arguments verticaly is of value. In actual > code, I _always_ concatenate > on to as few lines as necesary (tho' using double indentation for subsequent > lines) as I find it makes for much _more_ readable code. > Reaso

Re: Warnings suggest compiler confusion between 32 and 64 bit code.

2009-06-22 Thread Michael Ash
On Mon, Jun 22, 2009 at 12:42 PM, Kyle Sluder wrote: > On Mon, Jun 22, 2009 at 5:09 AM, Brian Bruinewoud wrote: >>    CGFloat c = 0.0L; > > The compiler is silent here because it knows that 0.0L is finitely > representable as a float (0.0). > > As for the other two occasions, you would need to comp

CalendarStore and delegated calendars

2009-06-22 Thread Steven Riggs
Hello all, Is it a bug or by design that the CalendarStore will not pick up delegated calendars? I've googled all night without an answer. Thanks in advance! -Steve ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post adm

Service not working

2009-06-22 Thread Guillem Palou
Hi folks, I'm trying to develop an application that acts as a service, but I cannot make it appear on the Services Menu and I cannot execute it on the applications. I tried to search for similar posts with no success and looked at the documentation at least 4 times with no luck either. Se

Re: Opinion on managed memory and garbage collection

2009-06-22 Thread Peter N Lewis
On 22/06/2009, at 22:58 , Phil Hystad wrote: If you were writing a new Cocoa application from scratch, would garbage collection be the preferred method over the reference counting (retain/release) method. Having spent years in Java I would prefer a GC'd approach but I have also seen the gre

Re: Programmatically Accessing Core Data Localization Strings

2009-06-22 Thread Sebastian Celis
Perfect! Thanks! - Sebastian On Mon, Jun 22, 2009 at 9:36 PM, Nick Zitzmann wrote: > > On Jun 22, 2009, at 7:56 PM, Sebastian Celis wrote: > >> I have a strings file defined for my Core Data model. As such, my >> Data.xcdatamodel file has a corresponding DataModel.strings file. This >> seems to

Re: Problem with NSValueTransformer, NSTableView and NSAttributedString

2009-06-22 Thread Jerry Krinock
On 2009 Jun 21, at 07:37, Donnie Lee wrote: I created NSTableView and bind table column with NSTextFieldCell with custom NSValueTransformer subclass to NSArrayController. My value transformer should return NSAttributedString transformed from NSString. Everything works fine except that the table

Re: stepping in unit test

2009-06-22 Thread Roland King
try google .. here's one link which describes how to do it. http://chanson.livejournal.com/120740.html Angelo Chen wrote: > Hi, > I'm using XCode 2.4.1, doing some unit test, is it possible to debug/step in > unit test classes? Thanks, > Angelo > > > Yahoo!香港提供網上安全攻略,教你如何防範黑客! 請前往 http:/

Re: IKImageBrowserView setSelectionIndex not selecting

2009-06-22 Thread Graham Cox
On 23/06/2009, at 10:08 AM, Richard Gutierrez wrote: I have been researching extensively on how to set an IKImageBrowserView's initial selection upon load to 0 index. Here is the call I am making: [imageBrowser setSelectionIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO]

stepping in unit test

2009-06-22 Thread Angelo Chen
Hi, I'm using XCode 2.4.1, doing some unit test, is it possible to debug/step in unit test classes? Thanks, Angelo Yahoo!香港提供網上安全攻略,教你如何防範黑客! 請前往 http://hk.promo.yahoo.com/security/ 了解更多! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) P

Re: Beginner Question Re: Memory Management

2009-06-22 Thread Graham Cox
On 23/06/2009, at 6:39 AM, Daniel Torrey wrote: I'm looking at some sample iPhone code, and in the app delegate's applicationDidFinishLaunching method, I see // Set up the view controller MyViewController *aViewController = [[MyViewController alloc] initWithNibName:@"HelloWorld" b

IKImageBrowserView setSelectionIndex not selecting

2009-06-22 Thread Richard Gutierrez
I have been researching extensively on how to set an IKImageBrowserView's initial selection upon load to 0 index. Here is the call I am making: [imageBrowser setSelectionIndexes:[NSIndexSet indexSetWithIndex:0] byExtendingSelection:NO]; Seems like the IKImageBrowserView is not fully loaded whe

Beginner Question Re: Memory Management

2009-06-22 Thread Daniel Torrey
Hi, I'm looking at some sample iPhone code, and in the app delegate's applicationDidFinishLaunching method, I see // Set up the view controller MyViewController *aViewController = [[MyViewController alloc] initWithNibName:@"HelloWorld" bundle:[NSBundle mainBundle]]; self.m

Re: Card Game (like Spider-Solitaire) in Cocoa -- Conceptual ideas needed

2009-06-22 Thread Florian Witteler
Hi guys! I created an Spider Solitaire branch on github (http://github.com/FloWi/MyGeekGameBoard/tree/master ) Not very clean yet - consider it as an initial hack to get it working ;-) Too bad, that CoreAnimation doesn't run on Tiger... My girlfriend has a MacMini with Tiger and loves to p

Re: Programmatically Accessing Core Data Localization Strings

2009-06-22 Thread Nick Zitzmann
On Jun 22, 2009, at 7:56 PM, Sebastian Celis wrote: I have a strings file defined for my Core Data model. As such, my Data.xcdatamodel file has a corresponding DataModel.strings file. This seems to work great for auto-generated messages, but now I have a need to access these localized strings p

Programmatically Accessing Core Data Localization Strings

2009-06-22 Thread Sebastian Celis
Hello, I have a strings file defined for my Core Data model. As such, my Data.xcdatamodel file has a corresponding DataModel.strings file. This seems to work great for auto-generated messages, but now I have a need to access these localized strings programmatically. NSLocalizedString does not seem

Re: number box class from NSTextField

2009-06-22 Thread Graham Cox
On 23/06/2009, at 4:19 AM, Stephen Blinkhorn wrote: The click and drag number box is very much a standard in audio applications, for example, Apple's Logic Pro. Audio apps do seem to plough their own furrow when it come to UI though - it's not necessarily going to generalise. But why no

Re: FirstResponder in 10.4

2009-06-22 Thread Graham Cox
On 23/06/2009, at 3:06 AM, iseecolors wrote: I have a NIB with a NSView that I use to populate a Contextual View in the Main Window. I have tried to set the firstResponder from IB, from init, from awakeFromNib, and from - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *

Re: number box class from NSTextField

2009-06-22 Thread Stephen Blinkhorn
That's a good point actually. Everything I do in my software happens inside one window with no scroll bars etc. For completeness here is my current number box class :) designed for non-editable text field naturally. Stephen ___ Cocoa-dev mailin

Re: number box class from NSTextField

2009-06-22 Thread Stephen Blinkhorn
On 22 Jun 2009, at 14:16, Quincey Morris wrote: (2) *Nested* wheel-scrolling behavior can be a frustration for users, because it forces them to stop and think what the effect of using the scroll wheel is going to be. This is just exacerbated when some of the behavior is "harmless" adjustmen

RE: Core Data Fetching Limitations?

2009-06-22 Thread Ulai Beekam
Thanks for your reply. This is a good idea. But in the end, won't my predicate have something like "SELF IN thatSetWeDeterminedUsingYourMethod"? As I said originally, I will need to combine a bunch of such predicates together to form an aggregate predicate. Much in a way that smart playlists

Re: Amount of Arguments per Method

2009-06-22 Thread Paul M
In documentation, stacking the arguments verticaly is of value. In actual code, I _always_ concatenate on to as few lines as necesary (tho' using double indentation for subsequent lines) as I find it makes for much _more_ readable code. Reasoning? - I wrote that code, or I've already read it care

Re: Approaches for this Matching Problem?

2009-06-22 Thread Chris Suter
Hi Gerriet, On Mon, Jun 22, 2009 at 10:46 PM, Gerriet M. Denkmann wrote: >> Bear in mind that some languages don't really have the concept of words. > > Could you please elaborate? Maybe some examples? I'm afraid I'm not an expert. I just remember hearing it said at WWDC (so bear in mind, it's s

Cascade Delete won't delete Department in Apple Sample Code

2009-06-22 Thread Jerry Krinock
Core Data documentation [1] describes the Cascade Delete Rule as follows: "Delete the objects at the destination of the relationship. For example, if you delete a department, fire all the employees in that department at the same time." In order to understand another problem, I tried this

Re: How to customize the context menu appearances.

2009-06-22 Thread Benjamin Dobson
On 22 Jun 2009, at 21:37:52, 慧 松本 wrote: Thank you for the IB Plugin BWToolkit. http://brandonwalkin.com/bwtoolkit/ I can implement transparent popup buttons in my HUD windows. But the menu, that appears from a transparent popup button, has still the same appearance as the normal menu, ie.

Re: How to customize the context menu appearances.

2009-06-22 Thread Kyle Sluder
Please don't repeatedly ask the same question. You asked the list yesterday. For the record, you can't customize the appearance of NSMenu. You can, however, use a borderless NSWindow to achieve the goal you desire, but as it is not a true menu it will not exhibit quite the same behavior as one.

How to customize the context menu appearances.

2009-06-22 Thread 慧 松本
Thank you for the IB Plugin BWToolkit. http://brandonwalkin.com/bwtoolkit/ I can implement transparent popup buttons in my HUD windows. But the menu, that appears from a transparent popup button, has still the same appearance as the normal menu, ie. white background and black character color

Re: number box class from NSTextField

2009-06-22 Thread Quincey Morris
On Jun 22, 2009, at 11:19, Stephen Blinkhorn wrote: On 22 Jun 2009, at 09:11, Graham Cox wrote: The standard way to handle this is to pair an ordinary text field with a stepper control (and maybe a slider, if you have space). The stepper allows the user to spin the value up or down while th

ABPeoplePickerView Drag & Drop

2009-06-22 Thread Barton Wells
I have an application with an ABPeoplePickerView in it. I notice that drag & drop does not work within the ABPeoplePickerView itself (that is, one cannot drag an ABPerson from the "Name" column into an ABGroup in the "Group" column, like one can in the Address Book application). Should th

Re: Amount of Arguments per Method

2009-06-22 Thread Greg Parker
On Jun 22, 2009, at 1:03 AM, Roland King wrote: This still the longest one or has Apple outdone themselves since? 11 args, you really wouldn't want much more than this. -(id) initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFo

Re: Approaches for this Matching Problem?

2009-06-22 Thread Ken Thomases
On Jun 22, 2009, at 1:25 PM, Steve Cronin wrote: Thanks as always for a thought-provoking and thorough response! Sure. :) 2) I don't see how looping on the 'words' in thePhrase would change the 'ham' issue you raise - it would still match either on the word or the phrase. Am I missing

Re: Warnings suggest compiler confusion between 32 and 64 bit code.

2009-06-22 Thread Greg Parker
On Jun 22, 2009, at 7:56 AM, Dave Carrigan wrote: On Jun 22, 2009, at 5:09 AM, Brian Bruinewoud wrote: warning: passing argument 1 of 'colorWithDeviceRed:green:blue:alpha:' as 'float' rather than 'double' due to prototype Turn off -Wconversion, which isn't a very useful warning these days

Re: Class Factory Methods?

2009-06-22 Thread I. Savant
You are confused because you are guessing and not verifying. Let's examine: On Jun 22, 2009, at 3:02 PM, Chunk 1978 wrote: "new", "alloc", initWithFormat" (or "stringWithFormat") are class factory methods that are declared methods inherited by my custom classes, i guess somewhere in NSObj

Re: Class Factory Methods?

2009-06-22 Thread Kyle Sluder
On Mon, Jun 22, 2009 at 12:02 PM, Chunk 1978 wrote: > "new", "alloc", initWithFormat" (or "stringWithFormat") are class > factory methods that are declared methods inherited by my custom > classes, i guess somewhere in NSObject? No. +alloc is a class method that creates a new instance. -initWithF

Class Factory Methods?

2009-06-22 Thread Chunk 1978
confused (seriously, what else is new?)... correct me if (where) i'm wrong: -=-=-=-=- -(void)myMethod { NSString *foo = [[NSString alloc] initWithFormat:@"bar"]; NSLog(foo); } -=-=-=-=- "new", "alloc", initWithFormat" (or "stringWithFormat") are class factory methods that are declared methods inh

Re: Approaches for this Matching Problem?

2009-06-22 Thread Steve Cronin
Ken; Thanks as always for a thought-provoking and thorough response! 1) I haven't given up on those Tiger users yet... 2) I don't see how looping on the 'words' in thePhrase would change the 'ham' issue you raise - it would still match either on the word or the phrase. Am I missing somethi

Re: number box class from NSTextField

2009-06-22 Thread Stephen Blinkhorn
On 22 Jun 2009, at 09:11, Graham Cox wrote: The standard way to handle this is to pair an ordinary text field with a stepper control (and maybe a slider, if you have space). The stepper allows the user to spin the value up or down while the text field allows them to type a value. I'm usin

How do I sync Quartz drawing-path coordinates with the physical iPhone UIView coordinates?

2009-06-22 Thread Frederick C. Lee
Greetings: Here's my (common) problem: I want to be able to use Quartz to draw an open path across an CGImage layout based on the GGImage coordinates. I use the UITouch object/click via Simulator to collect my screen coordinates and hence, to plot a path for Quartz to draw: CG

Re: Approaches for this Matching Problem?

2009-06-22 Thread Ken Thomases
On Jun 22, 2009, at 3:10 AM, Steve Cronin wrote: So I've been pondering and testing... 1) Why would I have to bust up/loop on thePhrase? BUT in my case I don't care where, what word or how often - I just want to know IF a tag occurs in thePhrase!! Then you shouldn't refer to "words". If

re: renaming executable files

2009-06-22 Thread Mr. George Warner
On Sun, 21 Jun 2009 06:47:26 -0700 (PDT), Angelo Chen > wrote: > I need to rename the executable file without renaming the project, how to do that? thanks -- Enjoy, George Warner, Schizophrenic Optimization Scientist Apple Developer Technical

re: Cocoa and Computational Expense

2009-06-22 Thread Mr. George Warner
On Sat, 20 Jun 2009 16:36:58 -0700 (PDT), syntonica wrote: > I am new to Cocoa (about 3 weeks now) and have not done much programming since the halcyon days of 16K RAM. WoW! a whole 16K!!! I remember paying > $50 each in 1974 for surplus 1103's, the worlds first 1K dynamic RAM. (Yeah, I ju

FirstResponder in 10.4

2009-06-22 Thread iseecolors
I have a NIB with a NSView that I use to populate a Contextual View in the Main Window. I have tried to set the firstResponder from IB, from init, from awakeFromNib, and from - (BOOL)control:(NSControl *)control textShouldBeginEditing:(NSText *)fieldEditor All of these work in 10.5 (+), bu

Re: Warnings suggest compiler confusion between 32 and 64 bit code.

2009-06-22 Thread Kyle Sluder
On Mon, Jun 22, 2009 at 5:09 AM, Brian Bruinewoud wrote: >    CGFloat c = 0.0L; The compiler is silent here because it knows that 0.0L is finitely representable as a float (0.0). As for the other two occasions, you would need to compile with data flow analysis (which I believe is triggered by -O2

Re: Opinion on managed memory and garbage collection

2009-06-22 Thread Phil Hystad
Wagnar, Thanks for the comments. I agree that experience in using retain/ release is good to have, especially with iPhone. Although I have no plans for an iPhone app right now, I certainly would not rule it out. I did do a kind of hello world using the iPhone simulator though -- maybe I

Re: Amount of Arguments per Method

2009-06-22 Thread Graham Cox
On 23/06/2009, at 1:03 AM, WT wrote: This brings to mind a peeve of mine: Apple's unofficially sanctioned practice, followed by a lot of people, of NOT throwing in some white space in between parts of method names. Programmers spend most of their time *reading* code (their own or other peo

Re: Opinion on managed memory and garbage collection

2009-06-22 Thread WT
On Jun 22, 2009, at 4:58 PM, Phil Hystad wrote: Being relatively new to Cocoa and Objective-C, what is the consensus on using the new version 2.0 managed memory features (garbage collection). If you were writing a new Cocoa application from scratch, would garbage collection be the preferr

Re: number box class from NSTextField

2009-06-22 Thread Graham Cox
On 23/06/2009, at 1:02 AM, Stephen Blinkhorn wrote: I need a scrolling number box type object for my GUI. At the moment I am subclassing NSTextField and overriding mouse and scroll wheel events so a user can drag the numeric value up/down. This seems a bit clumsy somehow. Perhaps a bet

Re: Amount of Arguments per Method

2009-06-22 Thread WT
On Jun 22, 2009, at 4:14 PM, Andy Lee wrote: On Jun 22, 2009, at 4:03 AM, Roland King wrote: This still the longest one or has Apple outdone themselves since? 11 args, you really wouldn't want much more than this. - (id )initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesP

number box class from NSTextField

2009-06-22 Thread Stephen Blinkhorn
Morning Cocoa-Dev, I need a scrolling number box type object for my GUI. At the moment I am subclassing NSTextField and overriding mouse and scroll wheel events so a user can drag the numeric value up/down. This seems a bit clumsy somehow. Perhaps a better idea would be a custom

Opinion on managed memory and garbage collection

2009-06-22 Thread Phil Hystad
Being relatively new to Cocoa and Objective-C, what is the consensus on using the new version 2.0 managed memory features (garbage collection). If you were writing a new Cocoa application from scratch, would garbage collection be the preferred method over the reference counting (retain/re

Re: Warnings suggest compiler confusion between 32 and 64 bit code.

2009-06-22 Thread Dave Carrigan
On Jun 22, 2009, at 5:09 AM, Brian Bruinewoud wrote: warning: passing argument 1 of 'colorWithDeviceRed:green:blue:alpha:' as 'float' rather than 'double' due to prototype Turn off -Wconversion, which isn't a very useful warning these days that everybody uses ANSI C. -- Dave Carrigan d

Re: Amount of Arguments per Method

2009-06-22 Thread Andy Lee
On Jun 22, 2009, at 4:03 AM, Roland King wrote: This still the longest one or has Apple outdone themselves since? 11 args, you really wouldn't want much more than this. - (id )initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmap

Re: Amount of Arguments per Method

2009-06-22 Thread Bill Bumgarner
On Jun 22, 2009, at 6:10 AM, Jack Carbaugh wrote: With that many arguments, i'd make a dictionary and pass only that dictionary. I understand your choice for not doing so however. Why? If you break up the call by hitting return after each argument and line up the colons (which Xcode will d

Re: Text Track to Subtitle Track

2009-06-22 Thread I. Savant
Don't cross-post. Pick the most relevant list for your question and post only to that list. For this question, your first choice was correct: quicktime-api. -- I.S. On Monday, June 22, 2009, Sandeep Nair wrote: > Hi, > Anybody know how to convert a text track to subtitle track. > i have doubt

Re: Approaches for this Matching Problem?

2009-06-22 Thread Gerriet M. Denkmann
On 22 Jun 2009, at 11:41, Chris Suter wrote: On Mon, Jun 22, 2009 at 6:10 PM, Steve Cronin wrote: But what is the right solution?? For finding word boundaries, I think you're supposed to use NSAttributedString's nextWordFromIndex:forward: and doubleClickAtIndex: methods. There also is C

Warnings suggest compiler confusion between 32 and 64 bit code.

2009-06-22 Thread Brian Bruinewoud
Hi all, In a custom view I have the following code (simplified for the purpose of this post): - (void)drawRect:(NSRect)rect { // Drawing code here. NSRect bounds = [ self bounds ]; NSLog( @"size of CGFloat %d, float %d, double %d, literal float %d, literal %d, long literal %d"

Re: Approaches for this Matching Problem?

2009-06-22 Thread WT
On Jun 22, 2009, at 10:10 AM, Steve Cronin wrote: BUT in my case I don't care where, what word or how often - I just want to know IF a tag occurs in thePhrase!! thePhrase = 8 words theTags = 150 words It seems that you have two sets (in the mathematical sense) and all you want to know is

Re: Amount of Arguments per Method

2009-06-22 Thread Roland King
That one's not mine, that's Apple's. The original poster asked what the longest one was, that's the longest Cocoa one I've come across. I didn't use it! On Jun 22, 2009, at 7:10 PM, Jack Carbaugh wrote: With that many arguments, i'd make a dictionary and pass only that dictionary. I unders

Re: Amount of Arguments per Method

2009-06-22 Thread Jack Carbaugh
With that many arguments, i'd make a dictionary and pass only that dictionary. I understand your choice for not doing so however. jack On Jun 22, 2009, at 4:03 AM, Roland King wrote: This still the longest one or has Apple outdone themselves since? 11 args, you really wouldn't want much mor

CIFilter

2009-06-22 Thread Mahaboob
I can apply filter effects to all the selected graphics and is working as expected when I'm changing its values by using sliders and text fields. When I'm re-selecting the graphics after applying some filter effects,I'm not able to set this graphics as default (by setting the filters default value

Text Track to Subtitle Track

2009-06-22 Thread Sandeep Nair
Hi, Anybody know how to convert a text track to subtitle track. i have doubt in how to read samples from a text track and add it in a subtitle track??? Thanks in Advance Sandeep ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post

Search field in ABPeoplePickerView.

2009-06-22 Thread Nikhil Khandelwal
Hi all, In my application, i m using ABPeoplePickerView on NSPanel to show the addresses. It is showing the addresses properly. But search field works properly if i show the panel at launch. If i launch the panel later on clicking on some button search field is not working. I also used the [MyP

Re: How to fill rectangle under vertical scroller?

2009-06-22 Thread Chris Suter
Hi Quincey, On Mon, Jun 22, 2009 at 2:33 PM, Quincey Morris wrote: > FWIW, the small "gotcha" in the sample code you linked to (AFAICT, since I > never tried it) is that it places the "placard" in the area normally > occupied by a scroll bar. The corner rect that the OP wants to draw is > slightl

Re: Approaches for this Matching Problem?

2009-06-22 Thread Chris Suter
Hi Steve, On Mon, Jun 22, 2009 at 6:10 PM, Steve Cronin wrote: > But what is the right solution?? For finding word boundaries, I think you're supposed to use NSAttributedString's nextWordFromIndex:forward: and doubleClickAtIndex: methods. Bear in mind that some languages don't really have the co

Re: Approaches for this Matching Problem?

2009-06-22 Thread Steve Cronin
Ken & Jerry; Thanks for the quick response! So I've been pondering and testing... 1) Why would I have to bust up/loop on thePhrase? This makes me face Jerry's issue of a universal solution for breaking on words. Just on general principal what would that solution be? [thePhrase componentsSep

Re: Amount of Arguments per Method

2009-06-22 Thread Roland King
This still the longest one or has Apple outdone themselves since? 11 args, you really wouldn't want much more than this. -(id)initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel: WT wrote: On Jun

Re: Amount of Arguments per Method

2009-06-22 Thread WT
On Jun 22, 2009, at 8:05 AM, Chunk 1978 wrote: clearly simplicity is important, but i'd like to know if there is a limit for the amount of arguments which a method can handle? I don't know if there's an upper limit, but I don't recall ever writing a method with more than 5 or 6 arguments. Wh

Re: Amount of Arguments per Method

2009-06-22 Thread Dave Keck
> clearly simplicity is important, but i'd like to know if there is a > limit for the amount of arguments which a method can handle? The C99 standard states that conforming compilers must support at least 127 function arguments. I don't know if GCC enforces a limit above this, but if it doesn't, t