Re: One more Document app style question

2014-10-19 Thread Mike Abdullah
> On 18 Oct 2014, at 17:19, Luther Baker wrote: > > Coming from an iOS background, I'm used to seeing (and encapsulating) the > creation of key Core Data components (persistent store, location, > contexts). Everything is pretty explicit and consequently easy to follow. > > When I use Xcode to g

One more Document app style question

2014-10-18 Thread Luther Baker
Coming from an iOS background, I'm used to seeing (and encapsulating) the creation of key Core Data components (persistent store, location, contexts). Everything is pretty explicit and consequently easy to follow. When I use Xcode to generate a desktop Document based app for me, that functionality

Re: Style question

2010-08-30 Thread vincent habchi
Hi again, first, thanks a lot to all of those who took five minutes of their own time to answer my "micro-poll". I really appreciate it. So, to wrap up, that's mainly up to each person's taste. I think I'll stick to the first solution I used since then. Thanks again! Vincent _

Re: Style question

2010-08-30 Thread Sean McBride
On Mon, 30 Aug 2010 08:37:08 -0700, Joar Wingfors said: >I think that it's definitively preferable to autorelease on the same >line. It keeps all memory management together, and it's much less likely >that later rearrangements of the code in question will result in memory leaks. And for those tha

Re: Style question

2010-08-30 Thread aglee
On 30 Aug, 2010,at 11:33 AM, Dave DeLong wrote: My personal preference is the latter example. My general rule of thumb is that once I -release or -autorelease an object, I shouldn't interact with it anymore, since I have relinquished ownership of said object.   Definitely true once you release,

Re: Style question

2010-08-30 Thread Joar Wingfors
On 30 aug 2010, at 08.29, Vincent Habchi wrote: > baz = [[[Foo alloc] init] autorelease]; I think that it's definitively preferable to autorelease on the same line. It keeps all memory management together, and it's much less likely that later rearrangements of the code in question will result

Re: Style question

2010-08-30 Thread Ken Thomases
On Aug 30, 2010, at 10:29 AM, Vincent Habchi wrote: > just an enquiry regarding coding style. What is considered best: > > baz = [[[Foo alloc] init] autorelease]; > … > return baz; > > or > > baz = [[Foo alloc] init]; > … > return [baz autorelease]; > > ? As with most style questions, there's

Re: Style question

2010-08-30 Thread A.M.
On Aug 30, 2010, at 11:29 AM, Vincent Habchi wrote: > Hi everybody, > > just an enquiry regarding coding style. What is considered best: > > baz = [[[Foo alloc] init] autorelease]; > … > return baz; > > or > > baz = [[Foo alloc] init]; > … > return [baz autorelease]; > > ? According to the

Re: Style question

2010-08-30 Thread Dave DeLong
My personal preference is the latter example. My general rule of thumb is that once I -release or -autorelease an object, I shouldn't interact with it anymore, since I have relinquished ownership of said object. The only time I don't follow that guideline is when I'm working inside a method th

Re: Style question

2010-08-30 Thread F van der Meeren
Prefer the first [[[Foo alloc] init] autorelease]; If there is a @throw between the creation and return, there is a chance (if not properly handled) that the autorelease won't be called. On 30 Aug 2010, at 17:29, Vincent Habchi wrote: > Hi everybody, > > just an enquiry regarding coding style

Style question

2010-08-30 Thread Vincent Habchi
Hi everybody, just an enquiry regarding coding style. What is considered best: baz = [[[Foo alloc] init] autorelease]; … return baz; or baz = [[Foo alloc] init]; … return [baz autorelease]; ? Thanks! Vincent___ Cocoa-dev mailing list (Cocoa-dev@lis

NSPopUpButton style question ... "Push" v.s. "Round Textured"

2008-07-18 Thread lbland
hi- The default NSPopUpButton button style is Push. But, I'm getting board of it and it looks old-style. I think the button style of Round Textured is more "modern". Now I see that Xcode 3.0 -> 3.1 changes the PUB button style to Round Textured (I think)! Looks yummy! Is "Round Textured" P

Re: Style Question (Robert Claeson)

2008-07-07 Thread Scott Ribe
> Should be possible, no? Emacs ;-) -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact

Re: Style Question (Robert Claeson)

2008-07-04 Thread Andreas Mayer
Am 04.07.2008 um 18:16 Uhr schrieb Gary L. Wade: For example, this kind of code just bugs me when I'm balancing braces back-and-forth: Well, I find *this* one preferable: #if WE_WANT_TO_ADD_THIS_FEATURE_IN_FINAL_BUILDS if (thisTestIsTrue && newFunctionalityIsAvailable) { #else if (thi

Re: Style Question (Robert Claeson)

2008-07-04 Thread Scott Ribe
> Of course, if you're only talking about a few hundred > lines, Oh yes, at most. *NEVER* the size code base you're talking about! -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev

Re: Style Question (Robert Claeson)

2008-07-04 Thread Gary L. Wade
Scott Ribe wrote: Anyways, it really is a personal preference. All arguments I've ever seen that try to claim one style or the other is more correct or safer, are B.S. (Including the one referenced--the bounds of a block were *ALWAYS* absolutely vitally important, well before objects & destructor

Re: Style Question (Robert Claeson)

2008-07-04 Thread Scott Ribe
> Actually, I couldn't agree more with the documentation! Funny thing is, although I've used the style he advocates for a very long time (15 years???), I don't agree with his reasoning. Indentation of *code* should be consistent, an object comes into scope where it's declared, not at an opening b

Re: Style Question: apology and correction

2008-06-30 Thread Rob Ross
On Jun 27, 2008, at 10:25 PM, Jens Alfke wrote: On 27 Jun '08, at 9:45 PM, Rob Ross wrote: Btw, how many people realize this convention comes from the early K&R C book, and the *only* reason they wrote it this way was to minimize the number of lines of text their examples would take up

[OT] Re: Style Question

2008-06-30 Thread Steve Byan
On Jun 28, 2008, at 1:25 AM, Jens Alfke wrote: On 27 Jun '08, at 9:45 PM, Rob Ross wrote: Btw, how many people realize this convention comes from the early K&R C book, and the *only* reason they wrote it this way was to minimize the number of lines of text their examples would take up o

RE: Style Question (Robert Claeson)

2008-06-30 Thread john darnell
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of Roni Music > Sent: Saturday, June 28, 2008 1:13 PM > To: cocoa-dev@lists.apple.com > Subject: Re: Style Question (Robert Claeson) > > the bottom of the page below has o

Re: Style Question

2008-06-29 Thread Hamish Allan
On Sat, Jun 28, 2008 at 6:15 AM, Alex Wait <[EMAIL PROTECTED]> wrote: > I was meaning to imply that if it was called "FirstName" would setFirstName > still be called? See the first word of Jens' reply. But more importantly, just as Jens says, unask the question :) Hamish

Re: Style Question (Robert Claeson)

2008-06-28 Thread Roni Music
the bottom of the page below has one opinion why one style is superior to the other, (at least when it comes to C++ and the way C++ objects behave when going out of scope) http://www.relisoft.com/book/lang/scopes/2local.html On 28 Jun 2008, at 06:30, Alex Wait wrote: I have noticed, co

Re: Style Question

2008-06-28 Thread Rob Ross
On Jun 28, 2008, at 6:39 AM, Sam Mo wrote: On Jun 28, 2008, at 4:54 AM, Robert Claeson wrote: On 28 Jun 2008, at 06:30, Alex Wait wrote: I have noticed, coming from C++ and Visual Studio (at school), a couple style differences if (value) { //do something } insteasd of if (value) {

Re: Style Question

2008-06-28 Thread Sam Mo
On Jun 28, 2008, at 4:54 AM, Robert Claeson wrote: On 28 Jun 2008, at 06:30, Alex Wait wrote: I have noticed, coming from C++ and Visual Studio (at school), a couple style differences if (value) { //do something } insteasd of if (value) { //do something } Also since I am using this

Re: Style Question

2008-06-28 Thread Robert Claeson
On 28 Jun 2008, at 06:30, Alex Wait wrote: I have noticed, coming from C++ and Visual Studio (at school), a couple style differences if (value) { //do something } insteasd of if (value) { //do something } Also since I am using this style, XCode doesn't tab in for me when I type {

Re: Style Question

2008-06-27 Thread Jens Alfke
On 27 Jun '08, at 9:45 PM, Rob Ross wrote: Btw, how many people realize this convention comes from the early K&R C book, and the *only* reason they wrote it this way was to minimize the number of lines of text their examples would take up on each page? It's a type-setting design decision,

Re: Style Question

2008-06-27 Thread Alex Wait
I was meaning to imply that if it was called "FirstName" would setFirstName still be called? I know the convention for naming variables. :) On Fri, Jun 27, 2008 at 10:13 PM, Jens Alfke <[EMAIL PROTECTED]> wrote: > > On 27 Jun '08, at 9:44 PM, Alex Wait wrote: > > if I have a member, let's say a

Re: Style Question

2008-06-27 Thread Jens Alfke
On 27 Jun '08, at 9:44 PM, Alex Wait wrote: if I have a member, let's say a NSString, called FirstName... would the setter still be setFirstName? Yes. But you shouldn't name the property "FirstName". Property and method (and instance variable) names should be lowercased. There are some ex

Re: Style Question

2008-06-27 Thread Shawn Erickson
On Fri, Jun 27, 2008 at 9:44 PM, Alex Wait <[EMAIL PROTECTED]> wrote: > I got another Style related question. /me points at ... http://developer.apple.com/documentation/Cocoa/Conceptual/CodingGuidelines/index.html -Shawn ___ Cocoa-dev mailing list (Co

Re: Style Question

2008-06-27 Thread Rob Ross
I love this one. This becomes a religious issue for some people. Both styles are popular, you should feel comfortable reading either one. Write in the one you like best. Btw, how many people realize this convention comes from the early K&R C book, and the *only* reason they wrote it this wa

Re: Style Question

2008-06-27 Thread Alex Wait
I got another Style related question. if I have a member, let's say a NSString, called FirstName... would the setter still be setFirstName? I notice how it capitalizes the first letter even if the member doesn't start with a capital letter. if I have a "three word" named variable, let's say firs

Re: Style Question

2008-06-27 Thread Shawn Erickson
On Fri, Jun 27, 2008 at 9:30 PM, Alex Wait <[EMAIL PROTECTED]> wrote: > Also since I am using this style, XCode doesn't tab in for me when I type { > then a return. It will if you enable it (at least it always does for me). Use whatever coding style you want however do try to follow Cocoa like n

Style Question

2008-06-27 Thread Alex Wait
I have noticed, coming from C++ and Visual Studio (at school), a couple style differences if (value) { //do something } insteasd of if (value) { //do something } Also since I am using this style, XCode doesn't tab in for me when I type { then a return. This is the style I "taught" and I