Re: A question in regards to AddInstanceForFactory

2019-09-26 Thread Eric Dolecki via Cocoa-dev
Mojave. Good to know though, thanks. Sent from my iPhone 11 Pro From: Gary L. Wade Sent: Thursday, September 26, 2019 11:33 AM To: Eric E. Dolecki Cc: cocoa-dev Subject: Re: A question in regards to AddInstanceForFactory Are you running on Mojave or Catalina

Re: A question in regards to AddInstanceForFactory

2019-09-26 Thread Gary L. Wade via Cocoa-dev
Are you running on Mojave or Catalina beta? I’ve found some things in some simulators work better when under Catalina beta. -- Gary L. Wade http://www.garywade.com/ > On Sep 26, 2019, at 5:37 AM, Eric E. Dolecki via Cocoa-dev > wrote: > > FYI: This only appears when running in a simulator. >

Re: A question in regards to AddInstanceForFactory

2019-09-26 Thread Eric E. Dolecki via Cocoa-dev
FYI: This only appears when running in a simulator. On Thu, Sep 26, 2019 at 8:31 AM Eric E. Dolecki wrote: > I am using Xcode 11.0 (11420a), targeting iOS 13, Swift 5, and playing > back a local audio file. Seems simple enough, but I am getting a console > print: > > let path = Bundle.ma

A question in regards to AddInstanceForFactory

2019-09-26 Thread Eric E. Dolecki via Cocoa-dev
I am using Xcode 11.0 (11420a), targeting iOS 13, Swift 5, and playing back a local audio file. Seems simple enough, but I am getting a console print: let path = Bundle.main.path(forResource: "Tchaikovsky_Rococo_Var_orch.mp3", ofType:nil)! let url = URL(fileURLWithPath: path)

Re: Properties: A question of style

2016-06-15 Thread dangerwillrobinsondanger
"What's New in Cocoa" Sent from my iPhone > On Jun 16, 2016, at 9:49 AM, Jeff Szuhay wrote: > > Tuesday? > Any close approximation of the title of his talk would be helpful. > >> On Jun 15, 2016, at 4:47 PM, dangerwillrobinsondan...@gmail.com wrote: >> >> Watch the Ali Ozer video from the ot

Re: Properties: A question of style

2016-06-15 Thread Jeff Szuhay
Tuesday? Any close approximation of the title of his talk would be helpful. > On Jun 15, 2016, at 4:47 PM, dangerwillrobinsondan...@gmail.com wrote: > > Watch the Ali Ozer video from the other day at wwdc. > He covers this very topic. ___ Cocoa-dev

Re: Properties: A question of style

2016-06-15 Thread Quincey Morris
On Jun 15, 2016, at 16:34 , Graham Cox wrote: > > If the property is ‘isFoo’, then in every situation (such as KVO, or using > dot syntax) I would be using the keypath “isFoo”, and that’s fine, but it’s > inconsistent with other properties that are not readonly, where the > underlying property

Re: Properties: A question of style

2016-06-15 Thread dangerwillrobinsondanger
Watch the Ali Ozer video from the other day at wwdc. He covers this very topic. Sent from my iPhone > On Jun 16, 2016, at 8:34 AM, Graham Cox wrote: > > >> On 16 Jun 2016, at 3:45 AM, Jens Alfke wrote: >> >> >>> On Jun 14, 2016, at 4:48 PM, Graham Cox wrote: >>> >>> @property (readonly)

Re: Properties: A question of style

2016-06-15 Thread Graham Cox
> On 16 Jun 2016, at 3:45 AM, Jens Alfke wrote: > > >> On Jun 14, 2016, at 4:48 PM, Graham Cox wrote: >> >> @property (readonly) BOOL isFoo; >> >> or: >> >> @property (readonly, getter=isFoo) BOOL foo; > > Are you asking whether it’s better to name a boolean property “foo” or > “isFo

Re: Properties: A question of style

2016-06-15 Thread Charles Srstka
> On Jun 14, 2016, at 8:42 PM, Steve Mills wrote: > >> On Jun 14, 2016, at 19:45, Charles Srstka > > wrote: >> >> if thisArray.empty { doSomething() } > > That's not what he suggested as the 2nd form. Look again. > > Steve via iPad Except that it is. The prope

Re: Properties: A question of style

2016-06-15 Thread Jens Alfke
> On Jun 14, 2016, at 4:48 PM, Graham Cox wrote: > > @property (readonly) BOOL isFoo; > > or: > > @property (readonly, getter=isFoo) BOOL foo; Are you asking whether it’s better to name a boolean property “foo” or “isFoo”? Or are you asking about the naming of the getter method for a no

Re: Properties: A question of style

2016-06-15 Thread Michael Starke
If I've though longer about my answer I would have seen that you only talk about read-only properties, I could have saved the comment. It's only useful for readwrite properties, because only then the asymmetric getter/setter situations can occur. > >> >> Hi all, >> >> Just a quick point for

Re: Properties: A question of style

2016-06-14 Thread Michael Starke
> On 15.06.2016, at 01:48, Graham Cox wrote: > > Hi all, > > Just a quick point for discussion. > > Suppose I have a read-only BOOL property. What’s better, to declare it as: > > @property (readonly) BOOL isFoo; > > or: > > @property (readonly, getter=isFoo) BOOLfoo; > > > Is there a

Re: Properties: A question of style

2016-06-14 Thread Quincey Morris
On Jun 14, 2016, at 18:55 , Steve Mills wrote: > > Why are you using a getter as a setter? I’m not. I’m saying, as far as I’m concerned, the property is “isAnimal”, not “animal”. (Obviously, in the case of an existing property for an existing class, I have to use whatever forms the class dec

Re: Properties: A question of style

2016-06-14 Thread Steve Mills
> On Jun 14, 2016, at 20:51, Quincey Morris > wrote: > > FWIW, I prefer to use the other form for setters, too. I don’t see why: > >self.animal = YES; > > is any improvement over: > >self.isAnimal = YES; > > even when it’s something less concrete, say: > >self.enabled = YES; >

Re: Properties: A question of style

2016-06-14 Thread Quincey Morris
On Jun 14, 2016, at 16:48 , Graham Cox wrote: > > n.b. I’d always use the latter form for read/write properties FWIW, I prefer to use the other form for setters, too. I don’t see why: self.animal = YES; is any improvement over: self.isAnimal = YES; even when it’s something le

Re: Properties: A question of style

2016-06-14 Thread Steve Mills
> On Jun 14, 2016, at 19:45, Charles Srstka wrote: > > if thisArray.empty { doSomething() } That's not what he suggested as the 2nd form. Look again. Steve via iPad ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin req

Re: Properties: A question of style

2016-06-14 Thread Charles Srstka
> On Jun 14, 2016, at 6:48 PM, Graham Cox wrote: > > Hi all, > > Just a quick point for discussion. > > Suppose I have a read-only BOOL property. What’s better, to declare it as: > > @property (readonly) BOOL isFoo; > > or: > > @property (readonly, getter=isFoo) BOOL foo; > > > Is th

Properties: A question of style

2016-06-14 Thread Graham Cox
Hi all, Just a quick point for discussion. Suppose I have a read-only BOOL property. What’s better, to declare it as: @property (readonly) BOOL isFoo; or: @property (readonly, getter=isFoo) BOOL foo; Is there any advantage to one over the other? n.b. I’d always use the latter form for read/

Re: a question concerning how to fire a message at the beginning of my application

2015-11-17 Thread Alex Hall
> On Nov 17, 2015, at 19:11, Quincey Morris > wrote: > > On Nov 17, 2015, at 15:59 , Scott Berry wrote: >> >> I was wondering would it be wiser for me to put a notification or an art. > > You mean “alert"? > >> This must be presented because otherwise this program could be dangerous >> w

Re: a question concerning how to fire a message at the beginning of my application

2015-11-17 Thread Quincey Morris
On Nov 17, 2015, at 15:59 , Scott Berry wrote: > > I was wondering would it be wiser for me to put a notification or an art. You mean “alert"? > This must be presented because otherwise this program could be dangerous > without the message. If it’s dangerous, you presumably would want the u

a question concerning how to fire a message at the beginning of my application

2015-11-17 Thread Scott Berry
Hello there, I was wondering would it be wiser for me to put a notification or an art. This must be presented because otherwise this program could be dangerous without the message. It has to do with flying. ___ Cocoa-dev mailing list (Cocoa-dev@l

Re: A question about NSScreen being autoreleased during loadNib()

2013-06-04 Thread Fritz Anderson
On 28 May 2013, at 5:50 AM, "Jacky.Seraph Mu" wrote: [On a Retina machine, after instantiating an NSWindow from a new window controller, an NSScreen pointer obtained earlier from another window/controller apparently is released, and the debugger shows funny values in its struct members. The ba

A question about NSScreen being autoreleased during loadNib()

2013-06-04 Thread Jacky.Seraph Mu
Hi, I am OSX developer. The problem I encountered is described as below: - (void)method1:(NSObject *)arg1 contextInfo:(NSObject *)arg2 { ... [self method2:arg1 screen:[self.windowController window].screen]; ... } - (void)method2:(NSObject *)arg1 scre

Re: A question about core data.

2012-04-12 Thread Michael Swan
isten." On 12 Apr, 2012, at 2:23 AM, cocoa-dev-requ...@lists.apple.com wrote: > Message: 12 > Date: Wed, 11 Apr 2012 00:18:12 +0200 > From: Michael Parchet > To: Cocoa-dev@lists.apple.com > Subject: A question about core data. > Message-ID: <4f84b1a4.7020...@sunrise

Re: A question about core data.

2012-04-12 Thread Felix Franz
Hello Michael, On 11.04.2012, at 00:18, Michael Parchet wrote: > Hello, > > I have started a billing project with coco and core data. In my project, I > have a form that the user must fill to add a customer (for example) but it > seems that core data have only an array controller with a manag

Re: A question about core data.

2012-04-12 Thread Mike Abdullah
Whoah, back up. It sounds like you've dived in over your depth. No, you don't have to use an array controller; you are free to modify the context as you wish. Using one of Cocoa's built-in controllers might well prove better for your task, it's hard to say. Fetch requests are what they say on t

A question about core data.

2012-04-11 Thread Michael Parchet
Hello, I have started a billing project with coco and core data. In my project, I have a form that the user must fill to add a customer (for example) but it seems that core data have only an array controller with a manage object context to manage the core data database. Is it true ? In some

Re: A question of memory management style

2011-07-18 Thread John Brownie
Thanks for the suggestions. I decided to go with having the handler object retain itself and release itself when the interaction is completed. That avoids having to have more instance variables in the document object to track handlers and release them when done. Also, thanks for the pointers t

Re: A question of memory management style

2011-07-18 Thread Ken Thomases
On Jul 18, 2011, at 8:18 AM, Scott Ribe wrote: > On Jul 17, 2011, at 10:32 PM, John Brownie wrote: > >> [HandlerClass createHandlerWith...] > > I think your model is correct, but Cocoa convention is that method names > beginning with create confer ownership to the caller. If the caller does not

Re: A question of memory management style

2011-07-18 Thread Scott Ribe
On Jul 17, 2011, at 10:32 PM, John Brownie wrote: > [HandlerClass createHandlerWith...] I think your model is correct, but Cocoa convention is that method names beginning with create confer ownership to the caller. If the caller does not need to release the object, the method name should not be

Re: A question of memory management style

2011-07-17 Thread vincent habchi
Hi! > In the document object, I am observing such an event, then creating a handler > and calling it. I have handled creation either by explicit allocation such as > [[HandlerClass alloc] initWith...] or by writing a class method to create an > object like [HandlerClass createHandlerWith...]. I

Re: A question of memory management style

2011-07-17 Thread Jens Alfke
On Jul 17, 2011, at 9:32 PM, John Brownie wrote: > In the document object, I am observing such an event, then creating a handler > and calling it. I have handled creation either by explicit allocation such as > [[HandlerClass alloc] initWith...] or by writing a class method to create an > obje

A question of memory management style

2011-07-17 Thread John Brownie
I'm a relative newcomer to Cocoa, and I'm rewriting my Carbon-based application in Cocoa, taking the opportunity to refactor and improve the structure of my code. One area is giving me some difficulty in working out what is appropriate. The basic idea is to split off the handling of a particul

Re: A Quick Look contribution and a question

2011-01-04 Thread Julien Jalon
Look at Apple provided code sample at: http://developer.apple.com/library/mac/samplecode/QuickLookDownloader/Introduction/Intro.html -- Julien Jalon On Monday, January 3, 2011, Brad Stone wrote: > I'm submitting this code for anyone who needs a quick hack to get Quick Look > working.  It's a

Re: A Quick Look contribution and a question

2011-01-03 Thread Seth Willits
On Jan 3, 2011, at 8:42 AM, Brad Stone wrote: > I don't think the Quick Look documentation is as robust as it can be, I'm > still trying to figure out how to do the same thing the right way. Roughly: @interface MyView : NSView { QLPreviewPanel * mQLPreviewPanel; } - (IBAction)toggle

A Quick Look contribution and a question

2011-01-03 Thread Brad Stone
I'm submitting this code for anyone who needs a quick hack to get Quick Look working. It's a hack because it's using AppleScript and the Quick Look Server debug and management tool. If you send an array of paths this will bring them up in a Quick Look window. I don't think the Quick Look docu

[Moderator] Re: A question

2010-08-26 Thread Scott Anguish
No. And this message is off topic in and of itself. It has nothing to do with Cocoa programming. On Aug 26, 2010, at 10:53 AM, Behrang Saeedzadeh wrote: > Hi, > > I have a domain name that might be interesting for iPhone, iPad, and > Mac software developers. Can I advertise it in this > maili

Re: A question

2010-08-26 Thread Joshua Tidsbury
> > Hi, > > I have a domain name that might be interesting for iPhone, iPad, and > Mac software developers. Can I advertise it in this > mailing list? No. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mo

A question

2010-08-26 Thread Behrang Saeedzadeh
Hi, I have a domain name that might be interesting for iPhone, iPad, and Mac software developers. Can I advertise it in this mailing list? Thanks in advance, Behrang Saeedzadeh http://www.behrang.org ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.co

[Moderator] Re: [OT] Re: A question of legality...

2009-11-23 Thread Scott Anguish
On Nov 23, 2009, at 1:10 PM, Alastair Houghton wrote: > On 23 Nov 2009, at 10:58, Michael Davey wrote: > >> I want to share with you all the 4 arch version of the mysql libs that I >> went to some trouble to make today, but in light of the information given to >> me today by Andrew Farmer, I d

Re: [OT] Re: A question of legality...

2009-11-23 Thread Jean-Daniel Dupas
Le 23 nov. 2009 à 19:10, Alastair Houghton a écrit : > On 23 Nov 2009, at 10:58, Michael Davey wrote: > >> I want to share with you all the 4 arch version of the mysql libs that I >> went to some trouble to make today, but in light of the information given to >> me today by Andrew Farmer, I do

[OT] Re: A question of legality...

2009-11-23 Thread Alastair Houghton
On 23 Nov 2009, at 10:58, Michael Davey wrote: > I want to share with you all the 4 arch version of the mysql libs that I went > to some trouble to make today, but in light of the information given to me > today by Andrew Farmer, I do not know if this is legal. > > Anyone know? This isn't real

A question of legality...

2009-11-23 Thread Michael Davey
I want to share with you all the 4 arch version of the mysql libs that I went to some trouble to make today, but in light of the information given to me today by Andrew Farmer, I do not know if this is legal. Anyone know? ___ Cocoa-dev mailing list (C

Re: A question involving properties

2009-10-11 Thread Michael de Haan
On Oct 11, 2009, at 3:26 PM, Karolis Ramanauskas wrote: I think your exercise obscured your goal too much. I think you are correct...but in the end, I got what I wanted out of this. The reason I did this though, was that recently there has been a lot of discussion about the correct way

Re: A question involving properties

2009-10-11 Thread Karolis Ramanauskas
Cool, I'm quite a beginner myself, so this may be not quite correct... When you set up your user interface using interface builder and when the application launches the window it automatically allocates and initializes all the objects you placed on the window. *I never tried to replace those object

Re: A question involving properties

2009-10-11 Thread Michael de Haan
On Oct 11, 2009, at 2:35 PM, Karolis Ramanauskas wrote: OK, perhaps I am misunderstanding you, but if you are simply trying to set the label of the NSTextField you may wanna do this. Well...what I was **really** trying to do was get my head around using properties/ivars correctly :-) B

Re: A question involving properties

2009-10-11 Thread Karolis Ramanauskas
OK, perhaps I am misunderstanding you, but if you are simply trying to set the label of the NSTextField you may wanna do this. You do not need to allocate NSTextField programmatically, it will be loaded automatically. @interface TestAppDelegate : NSObject { NSTextField * _textField; } @proper

A question involving properties

2009-10-11 Thread Michael de Haan
May I indulge the group. In doing the Hillegass challenge of Chapter 18 ( creating a doc based app to draw ovals), detoured to get a deeper understanding to Apples Sketch-112, which in turn lead to properties and ivars, which lead to this little demo app to give me some more insight into ho

A question of CFBundleIdentifier & kMDItemContentType

2009-10-05 Thread Timothy Reaves
I have a bundle wit the CFBundleIdentifier set using the form com.mycompany.myapp.mybundle. When I run mdls against it, the kMDItemContentType shows "dyn.ah62d4qmuhk2x42pxsv3g825bsu". I thought it was supposed to show the com.mycompany.myapp.mybundle. Any idea why this is? ___

Re: Help Book: "Ask a Question" Fails [solved]

2009-06-06 Thread K. Darcy Otto
menu). However, when the Help application has started, and the user types a search term into the "Ask a question" search field, the progress indicator to the left of the search field comes up, and nothing else happens. That is, the progress indicator spins as if its working, but

Re: Help Book: "Ask a Question" Fails

2009-06-05 Thread Fritz Anderson
has started, and the user types a search term into the "Ask a question" search field, the progress indicator to the left of the search field comes up, and nothing else happens. That is, the progress indicator spins as if its working, but no search terms ever come up. I have

Help Book: "Ask a Question" Fails

2009-06-04 Thread K . Darcy Otto
into the "Ask a question" search field, the progress indicator to the left of the search field comes up, and nothing else happens. That is, the progress indicator spins as if its working, but no search terms ever come up. I have abstracts, titles and keywords as part of my help f

Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate

2009-03-06 Thread Peter Ammon
On Mar 6, 2009, at 6:42 AM, David Hoerl wrote: [following up to a Jan 08 thread] > is it possible to modify the width of the NSTextField representing a "Number" in a NSPredicateEditorRowTemplate ? Yes, but not yet in Interface Builder. To do so programatically, get the row template, get

Re: A question about NSPredicateEditor and NSPredicateEditorRowTemplate

2009-03-06 Thread David Hoerl
[following up to a Jan 08 thread] > is it possible to modify the width of the NSTextField representing a "Number" in a NSPredicateEditorRowTemplate ? Yes, but not yet in Interface Builder. To do so programatically, get the row template, get the text field as the last member of the row te

Re: A question about Apple Policy

2009-03-04 Thread Andrew Farmer
On 04 Mar 09, at 18:07, Development wrote: Ok I'm working on a program that allows system administrators to access some features of the OS which are otherwise not normally available. In cases where required I've followed the guidlines for using the security framework. So what concerns me is

A question about Apple Policy

2009-03-04 Thread Development
Ok I'm working on a program that allows system administrators to access some features of the OS which are otherwise not normally available. In cases where required I've followed the guidlines for using the security framework. So what concerns me is because this app allows a user to make cha

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. Th

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 with

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 r

Re: A Question on estimating +arrayWithCapacity

2009-01-10 Thread Ashley Clark
On Jan 10, 2009, at 2:10 AM, Bill Bumgarner wrote: On Jan 9, 2009, at 7:11 PM, Ashley Clark wrote: This should apply to NSNumber and NSDecimalNumber too right? Yet the NSNumber +numberWith... methods are declared to return (NSNumber *) and when called on NSDecimalNumber they return NSDecim

Re: A Question on estimating +arrayWithCapacity

2009-01-10 Thread Bill Bumgarner
On Jan 9, 2009, at 7:11 PM, Ashley Clark wrote: This should apply to NSNumber and NSDecimalNumber too right? Yet the NSNumber +numberWith... methods are declared to return (NSNumber *) and when called on NSDecimalNumber they return NSDecimalNumber objects which then have to be typecast. Th

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread Ashley Clark
This should apply to NSNumber and NSDecimalNumber too right? Yet the NSNumber +numberWith... methods are declared to return (NSNumber *) and when called on NSDecimalNumber they return NSDecimalNumber objects which then have to be typecast. __ Ashley On Jan 9, 2009, at 7:45 PM, mmalc Cr

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread Jonathan Hess
+[NSMutableArray array] returns a mutable array. That's the reason the return type is + (id) and not + (NSArray *). When implementing connivence initializers, you should invoke [self alloc], not [ASpecificClass alloc]. Cocoa uses this pattern frequently, and you can safely depend on it. O

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread mmalc Crawford
On Jan 9, 2009, at 5:40 PM, Graham Cox wrote: On 10 Jan 2009, at 12:27 pm, Kyle Sluder wrote: Part of the problem that was addressed in the previous thread was that +array is not documented to actually give you a mutable instance. While in practice it works fine, there's no guarantee. Isn't

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread Kyle Sluder
On Fri, Jan 9, 2009 at 8:40 PM, Graham Cox wrote: > Isn't guaranteed by the semantics of inheritance? I've specified the class: > [NSMutableArray ... and what I want it to give me... array]; And the fact > that NSMutableArray inherits NSArray ensures that anything that array can > do, NSMutableArr

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread Graham Cox
On 10 Jan 2009, at 12:27 pm, Kyle Sluder wrote: Part of the problem that was addressed in the previous thread was that +array is not documented to actually give you a mutable instance. While in practice it works fine, there's no guarantee. Isn't guaranteed by the semantics of inheritance? I'

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread Kyle Sluder
On Fri, Jan 9, 2009 at 6:39 PM, Ken Thomases wrote: > And the reason many people don't realize they can do this is that they > overlook the superclass methods when considering a subclass. A lot of > people don't even know that they can send +array to NSMutableArray! Part of the problem that was

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread Ken Thomases
On Jan 9, 2009, at 8:11 AM, Graham Cox wrote: On 10 Jan 2009, at 1:07 am, Steve Cronin wrote: Under some circumstances I'm not sure how big a mutable object might need be. So is there any guidance on coming up with a value for capacity? [...] It feels a little like premature optimization,

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread Graham Cox
On 10 Jan 2009, at 1:07 am, Steve Cronin wrote: Folks; Under some circumstances I'm not sure how big a mutable object might need be. So is there any guidance on coming up with a value for capacity? Assume for these cases that reasonable guesses range from say 2 - 5000... I assume it's

A Question on estimating +arrayWithCapacity

2009-01-09 Thread Steve Cronin
Folks; Under some circumstances I'm not sure how big a mutable object might need be. So is there any guidance on coming up with a value for capacity? Assume for these cases that reasonable guesses range from say 2 - 5000... I assume it's wasteful to just do a land grab with +arrayWithCapa

Re: A question of style: Returning 'pairs'

2008-07-03 Thread David Casseres
I've run into this many times, and I think I've used all the techniques you mention and some others less hygienic. I've been most satisfied with your 2) and 3) solutions. There's not really that much overhead in making a struct or Obj-C class for two specific kinds of values, and once you'

Re: A question of style: Returning 'pairs'

2008-07-02 Thread Keith Duncan
2) Define a custom C struct (like NSRect, but with e.g. 'string' and 'offset' members) and return objects in it. Just like any other returned objects, the caller would be expected to retain them individually if it needed to keep them around. I'd probably do it this way if the method was pr

Re: A question of style: Returning 'pairs'

2008-07-02 Thread Bob Smith
When I find myself in the situation you describe, my first instinct is to re-examine the basic design to see if the code can be re- structured. In your case, a better approach might be to have two separate methods, one which just returns the string, and another which takes a string as argum

Re: A question of style: Returning 'pairs'

2008-07-02 Thread Joel Norvell
I'd use an NSArray for this, wrapping the offset in an NSNumber. Joel P.S. Note to Mr. Butler: The correct term is "complement"; not "compliment." ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin request

Re: A question of style: Returning 'pairs'

2008-07-02 Thread Andy Lee
On Jul 2, 2008, at 3:22 PM, Andy Lee wrote: There is quite a bit of precedent for methods of this form -- in the Xcode documentation window, you can ...enter "get" in the searchf field, and *then*... do an API "Starts With" search, sort by language, and look at the Objective-C methods.

Re: A question of style: Returning 'pairs'

2008-07-02 Thread Andy Lee
On Jul 2, 2008, at 2:48 PM, James Montgomerie wrote: 2) Define a custom C struct (like NSRect, but with e.g. 'string' and 'offset' members) and return objects in it. Just like any other returned objects, the caller would be expected to retain them individually if it needed to keep them arou

Re: A question of style: Returning 'pairs'

2008-07-02 Thread Jean-Daniel Dupas
half Of James Montgomerie Sent: Wednesday, July 02, 2008 2:48 PM To: Cocoa-Dev List Subject: A question of style: Returning 'pairs' Say I have a method that needs to return two equally important values (in my case, a string and an offset into it). I am overthinking how to do it, and I th

Re: A question of style: Returning 'pairs'

2008-07-02 Thread Stephen J. Butler
On Wed, Jul 2, 2008 at 1:48 PM, James Montgomerie <[EMAIL PROTECTED]> wrote: > 2) Define a custom C struct (like NSRect, but with e.g. 'string' and > 'offset' members) and return objects in it. Just like any other returned > objects, the caller would be expected to retain them individually if it >

RE: A question of style: Returning 'pairs'

2008-07-02 Thread Abernathy, Joshua
:48 PM To: Cocoa-Dev List Subject: A question of style: Returning 'pairs' Say I have a method that needs to return two equally important values (in my case, a string and an offset into it). I am overthinking how to do it, and I though it would be interesting to see what others have d

A question of style: Returning 'pairs'

2008-07-02 Thread James Montgomerie
Say I have a method that needs to return two equally important values (in my case, a string and an offset into it). I am overthinking how to do it, and I though it would be interesting to see what others have done. I see these opportunities (my use of 'object' and 'value' is blurred belo

Re: A question about Tabviews and tabview items

2008-04-14 Thread Development
Thank you very much for the suggestion. This looks to me to be the best approach to use so I will forgo the very complex subclassing of NSTabView I had begun in favor of this. On Apr 14, 2008, at 1:49 AM, Francisco Tolmasky wrote: Take a look at drawLabel:inRect and sizeOfLabel: in NSTabVi

Re: A question about Tabviews and tabview items

2008-04-14 Thread Development
You and one other both made this suggestion to me and examining it, it is certainly the easiest and most logical way to go. Which is probably why it did not occur to me. Thank you very much for your suggestion, I think this is the approach I will use. On Apr 13, 2008, at 9:26 PM, Sean Murph

RE: A question about Tabviews and tabview items

2008-04-14 Thread Francisco Tolmasky
Take a look at drawLabel:inRect and sizeOfLabel: in NSTabViewItem If however, you want do something more complex, consider putting the tabview in borderless mode, making your own UI around it, and just calling selectTabViewItem: appropriately. Francisco ___

Re: A question about Tabviews and tabview items

2008-04-13 Thread Sean Murphy
On Apr 13, 2008, at 6:24 PM, Development wrote: Is it possible to create a tabview who's tabviewitems have a custom look, For instance, the label is horizontal when the tabs are on the side, or can have icons? If so could I get a pointer to some info as I cant seem to find any. Rather tha

A question about Tabviews and tabview items

2008-04-13 Thread Development
Is it possible to create a tabview who's tabviewitems have a custom look, For instance, the label is horizontal when the tabs are on the side, or can have icons? If so could I get a pointer to some info as I cant seem to find any. ___ Cocoa-dev ma