Re: NSUInteger in for-loop?
Re: NSUInteger in for-loop?
- Subject: Re: NSUInteger in for-loop?
- From: Nathan Kinsinger <email@hidden>
- Date: Mon, 15 Sep 2008 12:17:12 -0600
On Sep 15, 2008, at 11:54 AM, Sean McBride wrote:
On 9/15/08 12:48 PM, Charles Srstka said:
-Wall yes, but -Wextra can get pretty obnoxious. In my experience,
that one tends to flood you with "unused parameter" warnings every
time you have an IBAction that doesn't use the "sender" parameter, or
you have a notification handler that doesn't use the notification
object, or you implement some API that requires you to implement
certain functions or methods that contain parameters you don't need,
Well, to each his own. I find it is a worthwhile tradeoff. For
action
methods, just do:
- (IBAction)handleButton:(id)sender
{
(void)sender;
...
}
There is also "#pragma unused", it's kind of ugly but is specific
about the parameter usage. Someone won't be looking through a long
method trying to find where notification is used if they see this:
- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
#pragma unused (notification)
// ... other stuff
}
--Nathan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden