I'm using a scrollview, and implementing a delegate method.
-(void) scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(CGPoint *)targetContentOffset{
CGPoint p = *targetContentOffset;
int counter = [self counterForPosition:p];
*targetContentOffset=[self positionForCounter:counter];;
//load month -2;
self.month=counter-2;
}
I get a warning by Xcode. Conflicting distributed object modifiers on parameter type in implementation of 'scrollViewWillEndDragging:withVelocity:targetContentOffset:'
I've found some hints, that I do not fully understand, and does not solve my issue. Singleton release method produces warning?
Now it's just a warning, and nothing crashes. I think it's my personal OCD that I want to fix this.
Tx
(CGPoint *)targetContentOffset
should read (inout CGPoint *)targetContentOffset
, to match the declaration in the protocol that you're trying to implement. See the documentation for the protocol here: http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIScrollViewDelegate_Protocol/Reference/UIScrollViewDelegate.html
FYI: in
, out
, inout
, byref
, bycopy
, and oneway
are collectively known as the "distributed object modifiers". They're sort of like annotations that tell the compiler (or the reader, or the documentation system) how you're going to be using the function parameters. In this case, targetContentOffset
points to a CGPoint whose value is used and then modified: it's both an in
and an out
parameter. Clang wants to be sure you know this, so if you haven't told Clang "yes, I know it's an inout
parameter", Clang will show you that warning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With