• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Adding NSLog() changes behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding NSLog() changes behavior


  • Subject: Re: Adding NSLog() changes behavior
  • From: Wade Tregaskis <email@hidden>
  • Date: Wed, 17 Mar 2004 09:29:27 +1100

Why all that? Why not just:

- (void)setImage:(NSImage*)newImage {

if ( image ) [image autorelease];
image = [newImage retain];

// Do stuff
}

Because now you've added the overhead of placing the object in an autorelease pool, which must involve at least some sort of list operation (probably using CFArray). It's better to add an extra line and not incur that overhead. It may be picking at straws, certainly, but ObjC is 'slow' enough without people getting lazy about typing an extra line. :)

Wade Tregaskis
-- Sed quis custodiet ipsos custodes?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Adding NSLog() changes behavior (From: Michael Becker <email@hidden>)
 >Re: Adding NSLog() changes behavior (From: Charles Srstka <email@hidden>)

  • Prev by Date: Re: Using bindings with an NSArray of NSStrings ?
  • Next by Date: Re: "Designated Initializer" pattern
  • Previous by thread: Re: Adding NSLog() changes behavior
  • Next by thread: UTC->NSDate in Cocoa.Needs to be localized depending on the locale.
  • Index(es):
    • Date
    • Thread