Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

andreab35

macrumors 6502a
Original poster
May 29, 2008
825
0
USA
Hey guys!

On the FlipsideView.h, I'm trying to make a UIButton, when clicked, open up Mail in order to send a message to an email address of mine.

I have gotten some code done: but I have "error: syntax error before "*" token"

Here's the code I have so far:

Code:
#import "FlipsideView.h"

@implementation FlipsideView


- (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        // Initialization code
    }
    return self;
}


- (void)drawRect:(CGRect)rect {
    // Drawing code
}

	- (IBAction) sendEmail: (id) sender
	
	NSURL *url = [[NSURL alloc] initWithString:@"mailto:email@gmail.com?subject=myhouse&body=suggestion that I would like to see featured."];
	[[UIApplication sharedApplication] openURL:url];
	
{

- (void)dealloc {
    [super dealloc];
}


@end

Anyone who can help me is appreciated! Thank you! :D
Sorry for being a noob- I'm still learning... :eek:
 

andreab35

macrumors 6502a
Original poster
May 29, 2008
825
0
USA
You're missing a '{'.

Haha, wow. I just figured that out myself! I was working without my glasses on and I couldn't see too well.

But my question is, is the { missing before when NSURL starts? I tried that and I got more errors.

Now I'm starting to get extremely confused for some odd reason... :(
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
But my question is, is the { missing before when NSURL starts? I tried that and I got more errors.
It's not so much missing as in the wrong place; it's the } that's missing. You need to start your block of code with the { and end it with the }. Like so:
Code:
- (IBAction) sendEmail: (id) sender
{
	NSURL *url = [[NSURL alloc] initWithString:@"mailto:email@gmail.com?subject=myhouse&body=suggestion that I would like to see featured."];
	[[UIApplication sharedApplication] openURL:url];
}
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.