存折 - 如何按存入日期对存折的传递进行排序

时间:2014-05-07 00:36:34

标签: ios passbook

Apple说:

使用PKPassLibrary类的pass方法获取您的应用有权访问的所有传递。通过以任意顺序返回。

PKPassLibrary *passLib = [[PKPassLibrary alloc] init];
NSArray *passArray = [passLib passes];
if ([passArray count] > 0)
{
    PKPass *lastPassAdded = [passArray objectAtIndex:0];
    NSLog(@"Pass Localized Name: %@",[lastPassAdded localizedName]);
    NSLog(@"Pass Organization Name: %@", [lastPassAdded organizationName]);
    NSLog(@"passTypeIdentifier =  %@", [lastPassAdded passTypeIdentifier]);
    NSLog(@"passSerial Number = %@",[lastPassAdded serialNumber]);
 [[UIApplication sharedApplication] openURL:[[passLib passWithPassTypeIdentifier:[lastPassAdded passTypeIdentifier] serialNumber:[lastPassAdded serialNumber]] passURL]];
}

在我的代码中,我可以获得所有优惠券,但不知道是否有表格按存折的包含日期排序

0 个答案:

没有答案