因此,我的密码汇编,在我用X条编码管理我的听器时,它便会发现一吨记忆错误,对坏出入提出抱怨,即对什么意思没有认识。 所有试图这样做的伊玛目都是从我的眼光中去除制造的实验室,在一阵列中使用一种反射剂,这种反射比想象的要困难得多。 我很新,反对任何帮助。
#import "FlipsideViewController.h"
@interface MainViewController : UIViewController <FlipsideViewControllerDelegate>
{
/*This stuff creates a timer */
IBOutlet UILabel *opponentsBlue;
NSTimer *timer;
int redBlue;
int count;
/*Stuff for making a label creator */
CGPoint startPoint;
int xStuff, yStuff;
/*array for storing wards*/
NSMutableArray *wardArray;
}
@property CGPoint startPoint;
- (IBAction)startRedBlue:(id)sender;
- (IBAction)removeWard:(id)
sender;
- (void)countdown;
-(id)init;
@end
#import "MainViewController.h"
@interface MainViewController ()
@end
@implementation MainViewController
@synthesize startPoint;
- (void)countdown
{
if (redBlue < 2) {
[timer invalidate];
timer = nil;
}
redBlue -= 1;
opponentsBlue.text = [NSString stringWithFormat:@"%i", redBlue];
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
UITouch *theTouch = [touches anyObject];
startPoint = [theTouch locationInView:self.view];
}
-(id)init{
int count = 0;
return self;
}
- (IBAction)startRedBlue:(id)sender
{
UIButton *wardButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
wardButton.frame = CGRectMake((startPoint.x - 5), (startPoint.y - 5), 10, 10);
[wardButton setTitle:@"180" forState:UIControlStateNormal];
//add targets and actions
/*[wardButton addTarget:self action:@selector() forControlEvents:<#(UIControlEvents)#>*/
//add to a view
[self.view addSubview:wardButton];
if (!wardArray) {
wardArray = [NSMutableArray array];
}
if (wardArray){
[self->wardArray addObject: wardButton];
count++;
}
NSLog(@"This elemnt = %@", wardArray);
}
- (IBAction)removeWard:(id)sender
{
NSLog(@"The count is %@", count);
[[wardArray objectAtIndex:count] removeFromSuperview];
count--;
NSLog(@"This elemnt = %@", wardArray);
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
#pragma mark - Flipside View
- (void)flipsideViewControllerDidFinish:(FlipsideViewController *)controller
{
[self dismissModalViewControllerAnimated:YES];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"showAlternate"]) {
[[segue destinationViewController] setDelegate:self];
}
}
@end