views:

33

answers:

2

CGAffineTransformMakeRotation(90);

How can I send mytextfield.text to CGAffineTransformMakeRotation like : CGAffineTransformMakeRotation(mytextfield.text);

+1  A: 

You just need to convert the string into a number.

CGAffineTransformMakeRotation([mytextfield.text floatValue]);
Joshua Weinberg
You may need to convert degrees to radians as well.
KennyTM
Maybe he wanted 90 radians :)
Joshua Weinberg
Sorry 90 degrees .. not radians ...
+1  A: 
#define DEGREES_TO_RADIANS(__ANGLE__) ((__ANGLE__) / 180.0 * M_PI)

-(IBAction)RotateButtonPressed:(id)sender;
{   
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:1.5];
    arrow.center = CGPointMake(151.0,80.0);
arrow.transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS([degrees.text floatValue]));
    [UIView commitAnimations];


}

Thats how I did convert from radians to degrees for CGAffineTransformMakeRotation

For anyones future reference