ios - Incompatible integer to pointer conversion assigning to 'CGFloat *' (aka 'float *') from 'int' -
i'm having problem cgfloat
. trying set value x of uiscrollview
actions when user change page using uibutton
that.
this error xcode gives me:
incompatible integer pointer conversion assigning 'cgfloat *' (aka 'float *') 'int'
this code:
.h
#import <uikit/uikit.h> @interface menuviewcontroller : uiviewcontroller <uiscrollviewdelegate> { } @property (nonatomic) cgfloat *offsetpoint; @property (weak, nonatomic) iboutlet uiscrollview *trackselectionscrollview; @end
.m
- (void)scrollforward { self.offsetpoint = self.trackselectionscrollview.contentoffset.x; // error here if ((self.offsetpoint = 0)) // error here { [self.trackselectionscrollview setcontentoffset:cgpointmake(320, 0) animated:yes]; } if ((self.offsetpoint = 320)) // error here { [self.trackselectionscrollview setcontentoffset:cgpointmake(640, 0) animated:yes]; } if ((self.offsetpoint = 640)) // error here { //last page nothing } }
if can't understand problem code i've posted post more of :-)
@property (nonatomic) cgfloat *offsetpoint;
this property storing pointer float , shouldn't be. change to:
@property (nonatomic) cgfloat offsetpoint;
Comments
Post a Comment