小编Fem*_*ina的帖子

如何在UIActivityViewController中设置邮件主题?

我想设置电子邮件共享主题UIActivityViewController,也想在Twitter上分享.我知道在Twitter上我们想分享 - 我们需要将文本压缩到140个字符.我检查了许多SO解决方案,但没有任何工作.

最新的iOS版本是否修复了此问题?还有其他"工作方案"吗?

email objective-c subject ios uiactivityviewcontroller

65
推荐指数
4
解决办法
3万
查看次数

如何在真实设备上测试Braintree + Apple Pay?

我正在为来自美国以外的美国客户开发使用Apple Pay的应用程序.我正在使用Braintree + Apple Pay.我们支持真实的信用卡到Passbook,但我们无法验证它们.

我成功生成了一个客户端令牌,self.braintree并尝试了BT的两种集成方式.

  1. BTPaymentProvider - 我们对付款方式创建的抽象.

    if(self.braintree && ![self.braintree isKindOfClass:[NSNull class]])
    {
        self.provider = [braintree paymentProviderWithDelegate:self];
        if ([self.provider canCreatePaymentMethodWithProviderType:BTPaymentProviderTypeApplePay])
        {
            self.provider.paymentSummaryItems = @[[PKPaymentSummaryItem summaryItemWithLabel:@"XXXX" amount:[NSDecimalNumber decimalNumberWithString:@"1"]]];
        }
        [self.provider createPaymentMethod:BTPaymentProviderTypeApplePay];
    }
    
    Run Code Online (Sandbox Code Playgroud)

    但它没有推动" PKPaymentAuthorizationViewController".跟踪它也不例外.

  2. PassKit - Apple的ApplePay API.

    if([PKPaymentAuthorizationViewController canMakePayments]) // It returns TRUE
    {
        PKPaymentRequest *paymentRequest = [[PKPaymentRequest alloc] init];
        paymentRequest.countryCode = @"US";
        paymentRequest.currencyCode = @"USD";
        paymentRequest.merchantCapabilities = PKMerchantCapabilityEMV | PKMerchantCapability3DS;
        paymentRequest.merchantIdentifier = MERCHANTID;
        paymentRequest.supportedNetworks = @[PKPaymentNetworkAmex, PKPaymentNetworkMasterCard, PKPaymentNetworkVisa];
        paymentRequest.paymentSummaryItems = @[ [PKPaymentSummaryItem summaryItemWithLabel:@"TEST" amount:[NSDecimalNumber …
    Run Code Online (Sandbox Code Playgroud)

google-app-engine objective-c braintree ios applepay

6
推荐指数
1
解决办法
2446
查看次数

NSPredicate 使用正则表达式检查字母数字

我想在 Objective c 中使用正则表达式检查字符串。我的代码

NSString *regexAmazonOrder =@"[a-zA-Z0-9]*";
NSPredicate *predicateAmazonOrder = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",regexAmazonOrder];

if([predicateAmazonOrder evaluateWithObject:cardNumber.text])
{
    NSLog(@"Its coming inside AMAZON ORDER EVALUATIONS");
    ...
}
Run Code Online (Sandbox Code Playgroud)

但它不起作用。帮帮我。我知道这很简单,但是却让我心碎!!!谢谢

regex objective-c nspredicate

5
推荐指数
2
解决办法
3634
查看次数

无法获取 Apple Pay 付款所需的信息,例如电子邮件、电话号码、街道等

  • 如何提取电子邮件、电话号码等值。我成功获得了帐单和送货地址。但是,我无法获得电子邮件和电话号码。请以编程方式建议我......(使用 kABPersonEmailProperty 等)

    • 此外,在

        (void) paymentAuthorizationViewController:(PKPaymentAuthorizationViewController*)controller
      
             didSelectShippingAddress:(ABRecordRef)address
                           completion:(void (^)(PKPaymentAuthorizationStatus, NSArray *, NSArray *))completion
        {
                  -------- // I am getting street property Nil. 
        }
      
      Run Code Online (Sandbox Code Playgroud)

所有人都建议从“didAuthorizePayment”获取,但我需要根据“街道”(如 POBox 位置等)动态生成运费。建议我解决这种情况。

在此处输入图片说明

objective-c ios passkit xcode6 applepay

5
推荐指数
1
解决办法
339
查看次数

获取"***因未捕获的异常而终止应用程序'NSInvalidArgumentException',原因:' - [__ NSCFNumber compare:]:nil参数'"

虽然我们有很多人问同样的问题,但没有一个答案有助于解决我的问题.所以这是我的代码,

AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc]initWithRequest:request];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {

    NSString *text = [[NSString alloc] initWithData:responseObject encoding:NSUTF8StringEncoding];
    NSLog(@"Response: %@", text);



    //The NSJSONSerialization method to transform the NSData responseObject into a dictionnary does work
    NSJSONSerialization *jsonResponse = [NSJSONSerialization JSONObjectWithData:responseObject options:0 error:nil];

    //This NSLog makes the app crash with an unrecognized selector sent error
    NSLog(@"JSON: %@",jsonResponse);

    NSArray *result1=(NSArray *)[jsonResponse valueForKeyPath:@"result"];

    NSLog(@"result1: %@",result1);

    NSMutableString  *shipPrice =[[NSMutableString alloc]init];
    NSMutableString  *freeLimitString =[[NSMutableString alloc]init];

    if(result1!=Nil && ![result1 count]==0)
    {
               for (int i=0; i<result1.count; i++) …
Run Code Online (Sandbox Code Playgroud)

objective-c ios afnetworking

-1
推荐指数
1
解决办法
3806
查看次数