error: synax error before '{' token

Posts 16–30 of 33 · Page 2 of 3
Quote Originally Posted by 'Bruno View Post
Code:
#import <Cocoa/Cocoa.h>

int main(int argc, char *argv[])
{
	return NSApplicationMain(argc, (const char **) argv);
}

#import "UberCalculatorController.h"
#import "UberCalculator_prefix.pch.h"

@implementation MasterView

- (id) initWithFrame: (CGRect) frame 
{
	//NSLog(@"MasterView initWithFrame");

	self = [super initWithFrame: frame];
	views = [[NSMutableArray alloc] init];
	currentViewIndex = -1;

	return self;
}

- (BOOL) canHandleSwipes 
{
	return TRUE;
}

- (int)swipe:(int)type withEvent:(struct __GSEvent *)event 
{
	//NSLog(@"MasterView swipe: %d withEvent: %@", type, event);
	int transType = 0;

	if (type == 4) 
	{ 
	// kUIViewSwipeLeft
	transType = 1;
	currentViewIndex--;
		if (currentViewIndex < 0) 
		{
			currentViewIndex = [views count] - 1;
		}
	} 
	else if (type == 8) 
	{ 
	//kUIViewSwipeRight
		transType = 2;
		currentViewIndex++;

		if (currentViewIndex == [views count]) 
		{
			currentViewIndex = 0;
		}
	}

	//NSLog(@"transition to view %d", currentViewIndex);
	if (transType != 0) 
	{
		[self transition:transType toView: [views objectAtIndex: currentViewIndex]]; 
	}

	// transition to current view
	return [ super swipe:type withEvent:event ];
}

- (void) addView: (id) fp8 
{
	[views addObject: fp8]; 
	if (currentViewIndex == -1) 
	{
		[super addSubview: fp8];
		currentViewIndex = 0;
	}
}

- (void) dealloc 
{
	[views release];
	[super dealloc];
}
@end

@implementation CalculatorApp

- (void) handleCommand: (NSString *) command
{
	//NSLog(@"CalculatorApp handleCommand: [%@]", command);

	// pass the commands down the chain
	[engine sendCommand: command];

	// then update all the views...
	[self updateViews];
}

- (void) updateViews 
{
	[basicCalculatorView updateView];
}

- (void) applicationDidFinishLaunching: (id) fp8 
{
	engine = [[CalculatorEngine alloc] init];


	struct CGRect frame = [UIHardware fullScreenApplicationContentRect];
	frame.origin.x = frame.origin.y = 0.0f;
	mainWindow = [[UIWindow alloc] initWithContentRect: frame];

	masterView = [[MasterView alloc] initWithFrame: frame];


	basicCalculatorView = [[BasicCalculatorView alloc] initWithFrame: frame withController: self withEngine: engine withType: 0];
	[masterView addView: basicCalculatorView];

	sciCalculatorView = [[BasicCalculatorView alloc] initWithFrame: frame withController: self withEngine: engine withType: 1];
	[masterView addView: sciCalculatorView];


	navView = [[UINavigationBar alloc] initWithFrame: CGRectMake(0.0f, 0.0f, 320.0f, 48.0f)];
	[navView showButtonsWithLeftTitle: @"Decimal" rightTitle: @"Hex" leftBack: YES];
	[navView setPrompt: @"Caclulator2"];
	[navView setBarStyle: 0];
	[navView enableAnimation];
	//[masterView addView: navView];

	diagView = [[UITouchDiagnosticsLayer alloc] initWithFrame: frame];
	[diagView setDisplayChargeMap: true];
	[diagView setDisplayHitRects: true];
	[diagView setDisplayTouchEvents: true];
	[diagView setTrackTouchEvents: true];
	//[masterView addView: diagView];


	[mainWindow orderFront: self];
	[mainWindow makeKey: self];
	[mainWindow _setHidden: NO]; 
	[mainWindow setContentView: masterView]; 
}

- (void)acceleratedInX:(float)xx Y:(float)yy Z:(float)zz 
{
	NSLog(@"accelerated x=%g, y=%g, z=%g", xx, yy, zz);
}

@end
looks better
That doesnt work
Quote Originally Posted by frozenasasin View Post

That doesnt work
its the same code as you posted, but it is just "cleaner" and easier to look at.

edit:
dude i just builded it and had no errors...
Have we just wasted a bunch of time, only to find out this works? Whatever no harm done
How can he get that error and now, he's like all fine? /facepalm
ROFLMFAO IRL!
Try to stay on topic guys.
Quote Originally Posted by Void View Post
Try to stay on topic guys.
i guess its just already answered david :\
hell should close it when he comes ^^
Quote Originally Posted by serpentine View Post
Where's HD? He's already failing as minion. >.<
You Mr Noob better shut up, Hell is almost always on... Literally, whenever I log on Messenger, he is on... Respect him, or you better fear the BanHammer!

Quote Originally Posted by Void View Post
Try to stay on topic guys.
Good Point:

Is this error resolved or not? Please answer so I can help.
Where's HD? He's already failing as minion. >.<
It does NOT work. ive tried it a million times but thanks for your effort on trying to help me! :-)
Quote Originally Posted by frozenasasin View Post
It does NOT work. ive tried it a million times but thanks for your effort on trying to help me! :-)
dude i just c&p what you gave and compiled it without problems..

plus i realized that you have 6 errors but showing only 3.. -.-
Pheraps your IDE is just acting Fuzzy, Happens sometimes with MiCrapSoft VStudio.

So ; Start a new xCode project and paste it in ?

You certainly just added a parameter than shouldn't be there to the compiler or something dumb like that, Just do what meh says =).

( Psst; Mel's Warranty does not cover.... Zombie Bites =). ... Okay Out of topic...)
Posts 16–30 of 33 · Page 2 of 3
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us