2
NSString *filePath = [[[NSBundle mainBundle] resourcePath]stringByAppendingPathComponent:@"freehugcoupon.pkpass"];
NSLog(@"Filepath = [%@]",filePath);
NSData *data = [NSData dataWithContentsOfFile:filePath];
NSError *error;
if (data != nil) {
PKPass *pass = [[PKPass alloc] initWithData:data error:&error];
NSLog(@"Error = [%@]",[error localizedDescription]);
if([passLib containsPass:pass]) {
UIAlertView* alertView = [[UIAlertView alloc] initWithTitle:@"Pass Exists" message:@"The pass you are trying to add to Passbook is already present." delegate:nil cancelButtonTitle:@"OK"otherButtonTitles:nil];
[alertView show];
[alertView release];
} else {
PKAddPassesViewController *vc = [[PKAddPassesViewController alloc] initWithPass:pass];
vc.delegate = self;
[self presentViewController:vc animated:YES completion:nil];
[vc release];
[pass release];
}
}
전무 내가 ...이다
있는 NSData 객체가 전무하다 얻고 로컬 경로에서 .pkpass 파일을 NSData을 위해 가져 오는 동안아무도 도와 줄 수 있습니다 미리 감사드립니다.
nslog (@ "% @", nsData)에 대한 nsdata 확인; – Bajaj