Re: Code style (was: Notify With Parameters)

2011-06-02 Thread Lee Ann Rucker
On Jun 2, 2011, at 1:05 PM, Sean McBride wrote: > On Thu, 2 Jun 2011 12:16:09 -0400, Jeffrey Walton said: > >> Slightly OT: Does Apple offer a tool similar to 'indent' for >> formatting? I've never tried indent on Objective C files because it >> does a miserable job on C++ source files. > > In

Re: Code style (was: Notify With Parameters)

2011-06-02 Thread Sean McBride
On Thu, 2 Jun 2011 12:16:09 -0400, Jeffrey Walton said: >Slightly OT: Does Apple offer a tool similar to 'indent' for >formatting? I've never tried indent on Objective C files because it >does a miserable job on C++ source files. In Xcode, see Edit > Format > Re-Indent. -- __

Re: Code style (was: Notify With Parameters)

2011-06-02 Thread Jens Alfke
On Jun 2, 2011, at 11:56 AM, Nathan Sims wrote: > Why would Google have an Objective-C style guide? Doesn't Apple own > Objective-C? Anyone can make a style guide for anything. Google has their own [screwy] homegrown coding style for C++ and Java that they use in their own code, and they writ

Re: Code style (was: Notify With Parameters)

2011-06-02 Thread Dave DeLong
On Jun 2, 2011, at 11:56 AM, Nathan Sims wrote: > On Jun 2, 2011, at 11:38 AM, Jens Alfke wrote: >> >> On Jun 2, 2011, at 1:17 AM, Conrad Shultz wrote: >> >>> Google's Objective-C style guide >>> (http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml) >>> directs that spaces in method

Re: Code style (was: Notify With Parameters)

2011-06-02 Thread Nathan Sims
On Jun 2, 2011, at 11:38 AM, Jens Alfke wrote: > > On Jun 2, 2011, at 1:17 AM, Conrad Shultz wrote: > >> Google's Objective-C style guide >> (http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml) >> directs that spaces in method declarations be minimized. For example: > > There’s a l

Re: Code style (was: Notify With Parameters)

2011-06-02 Thread Jens Alfke
On Jun 2, 2011, at 1:17 AM, Conrad Shultz wrote: > Google's Objective-C style guide > (http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml) > directs that spaces in method declarations be minimized. For example: There’s a lot of Google’s code style that I hate, and I wouldn’t hold i

Re: Code style (was: Notify With Parameters)

2011-06-02 Thread Steven Woolgar
> Slightly OT: Does Apple offer a tool similar to 'indent' for > formatting? I've never tried indent on Objective C files because it > does a miserable job on C++ source files. I use Uncrustify Hope that helps. W. ___

Re: Code style (was: Notify With Parameters)

2011-06-02 Thread Jeffrey Walton
On Thu, Jun 2, 2011 at 4:17 AM, Conrad Shultz wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 6/1/11 11:45 PM, Bing Li wrote: >> Dear all, >> >> I have a question on delegate/notification techniques in Cocoa. > > Roland and Jens have already addressed your main issue (you can also

Re: Code style (was: Notify With Parameters)

2011-06-02 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 6/1/11 11:45 PM, Bing Li wrote: > Dear all, > > I have a question on delegate/notification techniques in Cocoa. Roland and Jens have already addressed your main issue (you can also look at my response to Dan Hopwood a few days ago on a related iss

Re: Notify With Parameters

2011-06-02 Thread Jens Alfke
On Jun 2, 2011, at 12:32 AM, I wrote: >> // The following code cannot be compiled. >> // NSString *message = "Happy holidays!"; >> // [[NSNotificationCenter defaultCenter] postNotificationName:@"Done" >> object:message]; > > Why can’t it be compiled? I don’t see any errors in t

Re: Notify With Parameters

2011-06-02 Thread Roland King
can't be compiled because he's done NSString *message = "Happy Holidays!"; instead of the proper syntax for a string constant NSString *message = @"Merry Christmas!"; or else the compiler hates 'Happy Holidays' as much as I do. On 02-Jun-2011, at 3:32 PM, Jens Alfke wrote:

Re: Notify With Parameters

2011-06-02 Thread Jens Alfke
On Jun 1, 2011, at 11:45 PM, Bing Li wrote: > My question is if it is possible to transmit data from WorkingApp to > AppController? Sure; that’s what the userInfo dictionary in NSNotification is for. >// The following code cannot be compiled. >// NSString *message = "Happy holi

Notify With Parameters

2011-06-01 Thread Bing Li
Dear all, I have a question on delegate/notification techniques in Cocoa. For example, a simple delegate/notification sample is as follows. My question is if it is possible to transmit data from WorkingApp to AppController? Now AppController can only get notified about the Print job is done. If s