好的,所以我已经玩了几天了,我还没有得到这个工作,期待你的帮助!基本上,一旦 IAP 完成,我想“解锁”一项功能。我有 IAP 代码可以工作,但我想更改按钮“sendMail”(在 Interface Builder 中为“禁用”),以便用户可以与之交互。
//InputViewController.h
#import "IAPStore.h"
@interface InputViewController : UIViewController <MFMailComposeViewControllerDelegate, UIAlertViewDelegate>
@property(strong,nonatomic)IBOutlet UIButton *sendMail;
-(void)enableMail;
....
@end
//InputViewController.m
#import "InputViewController.h"
#import "IAPStore.h"
-(void)enableMail
{
[_sendMail setEnabled:YES];
NSLog(@"Unlocking Button");
}
//IAPStore.h
#import "InputViewController.h"
@interface IAPHelper : NSObject <UIAlertViewDelegate>
-(void)purchaseComplete;
...
@end
//IAPStore.m
#import "InputViewController.h"
-(void)purchaseComplete
{
UIAlertView *purchased = [[UIAlertView alloc]initWithTitle:@"In-App Purchase" message:@"Purchase complete! Thank you!" delegate:nil
cancelButtonTitle:@"OK" otherButtonTitles:nil];
GROWInputViewController *viewController = [[GROWInputViewController alloc] init];
[viewController enableMail];
[purchased show];
NSLog(@"button enabled");
}
所以它也打印出日志,但另一个视图控制器上没有任何改变,但没有任何改变,知道我做错了什么吗?