Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 1    Views: 60

CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
03/19/14 08:12 AM (10 years ago)

In app purchase

http://www.buzztouch.com/forum/thread.php?tid=80FF77F1DF0C5D1463A01E2 Following the above post can I use the same method that calls when the button is tapped, on a screen without a nib file? Im thinking because it uses IBaction I would need a nib. I want to call the method from a nav bar button to remove ads. UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithTitle:@"Remove Ads" style:UIBarButtonItemStylePlain target:self action:@selector(iappTapped)]; [self.navigationItem setLeftBarButtonItem:leftButton]; Can someone point me in the right direction?
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
03/19/14 11:10 AM (10 years ago)
This is the method for the example.Could I still use this if the screen doesnt have a nib??? - (IBAction)iapTapped:(UIButton *)sender { alert = [[UIAlertView alloc] initWithTitle:@"Buy this awesome in-app purchase" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Buy", @"Restore", nil]; [alert show]; } Or can I do it this way? - (void) iappTapped:(id)paramSender{ alert = [[UIAlertView alloc] initWithTitle:@"Buy this awesome in-app purchase" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Buy", @"Restore", nil]; [alert show]; } or this way? - (void) iappTapped:(UIButton *)button { alert = [[UIAlertView alloc] initWithTitle:@"Buy this awesome in-app purchase" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Buy", @"Restore", nil]; [alert show]; }
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.