SwingerDinger
SwingerDinger

Reputation: 276

Can't set String to URLWithString

I'm having an issue with a action to a Facebook page.

The currentVriend is a NSObject Class.

I get the error: too many arguments to method call expected 1 have 2

-(void)goFB
{
    NSURL *url = [NSURL URLWithString:@"fb://profile/%g",self.currentVriend.fbid];
    [[UIApplication sharedApplication] openURL:url];
}

What am I'm doing wrong? Maybe make another String? Thanks

Upvotes: 0

Views: 47

Answers (1)

rooster117
rooster117

Reputation: 5552

I believe you are missing the correct NSString method

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"fb://profile/%g",self.currentVriend.fbid]];

Upvotes: 3

Related Questions