Tag: iphone

如何让我的AVPlayer在应用程序在后台播放?

我已经完成了我的功课…一直在这里阅读,文档,谷歌search,stackoverflowing …但仍然没有运气让我的声音棒,当用户使应用程序进入后台。 到目前为止我所做的:将UIBackgroundModes,audio添加到plist文件。 首先这个代码: radioAudio = [[AVAudioSession alloc] init]; [radioAudio setCategory:AVAudioSessionCategoryPlayback error:nil]; [radioAudio setActive:YES error:nil]; 那么这个: NSString *radioURL = @"http://xxx.xxx.xxx/radio.m3u"; radioPlayer = [[AVPlayer playerWithURL:[NSURL URLWithString:radioURL]] retain]; 但只要用户点击主页button,我的声音就会消失。 我也发现这个,但没有添加cuase一些我读过的东西说这是不需要的; newTaskId = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:NULL]; if (newTaskId != UIBackgroundTaskInvalid && bgTaskId != UIBackgroundTaskInvalid) [[UIApplication sharedApplication] endBackgroundTask: bgTaskId]; bgTaskId = newTaskId; 现在我不知道该怎么去让我的AVPlayer让广播歌曲,而用户在电话上做其他的东西。 我正在用4.2testingiPhone 4。 build设4.0。 任何人有什么build议我应该做的?

在iOS 7中获取联系人

此代码适用于iOS5 / iOS6,但不适用于iOS7。 CFErrorRef *error = NULL; ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, error); //ABAddressBookRef addressBook = ABAddressBookCreate(); CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook); CFIndex numberOfPeople = ABAddressBookGetPersonCount(addressBook); for(int i = 0; i < numberOfPeople; i++) { ABRecordRef person = CFArrayGetValueAtIndex( allPeople, i ); NSString *firstName = (__bridge NSString *)(ABRecordCopyValue(person, kABPersonFirstNameProperty)); NSString *lastName = (__bridge NSString *)(ABRecordCopyValue(person, kABPersonLastNameProperty)); // […]

在iOS 5.1中获取CellID,MCC,MNC,LAC和networking

我需要在iOS 5.1(iPhone 4S)中检索当前服务单元塔的CellID,MCC,MNC,LAC和networking(GSM,3G)。 我知道这个信息是可用的,因为我可以在FieldTest模式下看到它(调用**** 3001#12345#****后可以访问)。 我想它可以通过私人/未logging的iOS框架访问。 在iphone的问题,检查cellId / Lac作者指出我可以在iOS上获得无线电信息cellId,Lac,MNC,MCC的值 ,但没有提供有关如何做到这一点的信息。 有谁能告诉我如何得到这个信息?

UIButton不会在iOS7中显示突出显示

我已经看了很多类似的东西的post,但没有一个相当匹配或解决这个问题。 自iOS 7以来,每当我添加一个UIButton到一个UITableViewCell ,甚至到footerview,它的工作原理是“很好”,这意味着它接收到目标动作,但不会显示通常发生在您点击一个UIButton的小突出显示。 它使界面看起来很时髦,不会显示button对触摸的反应。 我敢肯定,这是iOS7中的一个错误,但任何人都find了解决scheme或可以帮助我find一个:) 编辑:我忘了提及,如果我长时间按住button,它会突出显示,但不是像刚刚添加到标准视图那样快速点击。 码: 创buildbutton: UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; button.titleLabel.font = [UIFont systemFontOfSize:14]; button.titleLabel.textColor = [UIColor blueColor]; [button setTitle:@"Testing" forState:UIControlStateNormal]; [button addTarget:self action:@selector(buttonPressed:) forControlEvents: UIControlEventTouchDown]; button.frame = CGRectMake(0, 0, self.view.frame.size.width/2, 40); 我testing过的东西: //移除UITableView上的手势识别器,以防止它们UITableView 。 for (UIGestureRecognizer *recognizer in self.tableView.gestureRecognizers) { recognizer.enabled = NO; } //从Cell中删除手势 for (UIGestureRecognizer *recognizer in self.contentView.gestureRecognizers) […]

iOS 8 – 无法安装企业应用程序

我们公司有一个应用程序,可以通过使用企业分布的网站下载。 在iOS 8 Beta 5中,点击下载链接会popup“(网站)想要安装(应用程序名称)”的预期popup窗口。 点击“安装”该对话框首先导致应用程序卡住“等待…” 直到最后表示:“无法下载应用程序(应用程序名称)目前无法下载。” 按照预期使用iOS 7安装工程。 在iOS 8下从Xcode运行应用程序。 我们如何支持企业分发iOS 8? 也许需要对Manifest文件进行更改? 当我尝试在Xcode 6 Beta 7中构build应用程序时,企业存档过程不会提示我创build清单文件…

Xcode没有故事板和ARC

我已经下载了新的xcode-5,并开始使用它。 我们可以直接创build应用程序,包括故事板和ARC,它不要求像早期版本的选项。 所以,我的问题是我们如何使用Xcode5没有ARC和故事板。 我们必须手动删除故事板文件? 或者还有其他的select。

AVFoundation,如何captureStillImageAsynchronouslyFromConnectionclosures快门声音?

我正尝试从AVFoundation captureStillImageAsynchronouslyFromConnection的实时预览中捕捉图像。 到目前为止,该scheme按预期工作。 但是,怎样才能使快门声音静音?

如何从iphone应用程序发送邮件而不显示MFMailComposeViewController?

我想从我的自定义iPhone应用程序发送邮件。 我已经使用MFMailComposeViewController发送邮件从我的iPhone在我以前的应用程序。 现在,我不想向用户展示MFMailComposeViewController ,如果点击Send Mail button ,邮件自动发送到recipient mail address 。 我怎样才能做到这一点? 你能帮我吗? 提前致谢。 我用下面的代码来显示MFMailComposeViewController, MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init]; controller.mailComposeDelegate = self; [controller setSubject:@"Details"]; [controller setMessageBody:@"Hi" isHTML:NO]; [controller setToRecipients:[NSArray arrayWithObjects:@"abcd.m@gmail.com", nil]]; [self presentModalViewController:controller animated:YES]; [controller release];

在iPhone上查找安装的应用程序列表

是否可以编程的方式find我的iOS设备上安装的所有应用程序的名称? 有没有可用的API? 谢谢您的帮助

UIPickerView看起来像UIDatePicker,但秒

我正在制作一个计时器应用程序,需要显示小时,分钟和秒钟给用户。 我尝试使用UIDatePicker但它只显示小时和分钟作为select。 不是几秒钟。 在网上做了一些研究之后,我发现在UIDatePicker没有办法得到秒数,我不得不从头开始写自己的UIPickerView 。 所以我的问题是,有这样的示例代码,即有人写了CustomUIPickerView小时,分钟和秒,我可以在我的项目中纳入? UIDatePicker有一个很好的覆盖时间和分钟的文字,保持在用户旋转拨号时。 如果有人在他们的自定义选取器中添加了这个,那也不错。 如果不需要,我宁愿不要从头开始写一个自定义的UIPickerView 。 谢谢。