I would recommend renaming that method. Per Cocoa conventions, methods that start with "new" should return an object with an outstanding retain count like +alloc... and -copy do (among others).
On Thu, Aug 27, 2009 at 3:29 AM, Reza Farhad<r...@qu-s.eu> wrote: > Dear all > > I am running my code through xcode "Build and Analyze" to check for bugs. > I have the function below which gives me the following error: > > Object with +0 retain counts returned to caller where a +1 (owning) retain > count is expected > > I can not understand why can anybody enlighten me. > > -( NSColor *)newColour > { > NSColor *todoColour = nil; > float newRed, newGreen, newBlue; > float newAverage; > do{ > todoColour = [ self variationOnColor:colour ]; > [ todoColour getRed:&newRed green:&newGreen blue:&newBlue > alpha:nil ]; > newAverage = ( newRed + newGreen + newBlue )/3; > }while( newAverage < 0.5 ); > return todoColour; > } > > thanks > > Reza > > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/clarkcox3%40gmail.com > > This email sent to clarkc...@gmail.com > -- Clark S. Cox III clarkc...@gmail.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com