xcode6 - trying to make a button spin in Xcode with 6.3.2 objective-C -


i watched video on how make button spin in objective-c. entered code in video except got syntex errors/ "!". new xcode , know of basics javascript. please have been trying figure out long.

this did in viewcontroller.h:

 //  viewcontroller.h   #import <uikit/uikit.h>  #import <quartzcore/quartzcore.h>  #import <avfoundation/avfoundation.h> 

this part in code "!", doesn't seem "()". when take part out it's fine button doesn't seem recognized when called later on in viewcontroller.m. i'll explain each "!" says write of code i'm getting each error. separate code ill put 2 "//" next it.

@interface viewcontroller : uiviewcontroller( // ! method type specifier must start '-' or '+' 

i 3 error messages on next line of code.

iboutlet uibutton *button; //! iboutlet attribute ignored when parsing type, expected selector objective-c method, , expected ')'  ) //! expected identifier or '('                                               - (ibaction)spin:(id)sender;   @end   here's did in viewcontroller.m   //  viewcontroller.m    #import "viewcontroller.h"  @interface viewcontroller ()  @end  @implementation viewcontroller  - (void)viewdidload {  [super viewdidload];  // additional setup after loading view, typically nib.  }  - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. }  - (ibaction)spin:(id)sender {  cabasicanimation *fullrotation = [cabasicanimation   animationwithkeypath:@"transform.rotate" ];  fullrotation.fromvalue = [nsnumber numberwithfloat:0];  fullrotation.tovalue = [nsnumber numberwithfloat:((360*m_pi)/180)];  fullrotation.duration = 2.0;  fullrotation.repeatcount = 300;   in part of code "!" again no matter change   [button.layer addanimation:fullrotation forkey:@"360"]; //! use of undeclared identifier 'button'    } @end 

uiviewcontroller( should not have ( on end.


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -