Tag: ios5

在采取行动之前如何知道几个街区是否已经完成执行?

我正在使用animateWithDuration:animations:completion:在removeFromSuperview:之前移动我的用户界面的几个元素(大约4个元素) removeFromSuperview:被调用。 我的问题是,在调用removeFromSuperview:之前,如何知道所有这些animation已经完成?

我如何find从辅助线程调用UIKit实例?

我的应用程序在iOS 5中崩溃,因为我有一些从辅助线程调用UIKit实例的代码。 当您看到以下错误时,您知道您有这个问题: 布尔_WebTryThreadLock(布尔),0x811bf20:不允许在Web线程上的多个锁! 请提交一个错误。 现在崩溃… 所以我的问题是什么是一些方法,我可以find从辅助线程调用UIKit实例的代码? 以下是我已经试过的一些东西: 注释掉可能违反规则的块 在可能在辅助线程中处理的地方添加了assert([NSThread isMainThread]) 为_WebTryThreadLock添加了一个符号断点 这些东西帮助我find问题的地方。 但是,在最后的崩溃中, _WebTryThreadLock断点在任何其他线程中都没有堆栈跟踪。 那么,我怎样才能find没有堆栈跟踪导致问题的代码? 谢谢你的时间!

iOS使用MPMoviePlayerController播放video

我得到这段代码: theMoviPlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:@"/Resources/disc.mp4"]]; theMoviPlayer.controlStyle = MPMovieControlStyleFullscreen; theMoviPlayer.view.transform = CGAffineTransformConcat(theMoviPlayer.view.transform, CGAffineTransformMakeRotation(M_PI_2)); UIWindow *backgroundWindow = [[UIApplication sharedApplication] keyWindow]; [theMoviPlayer.view setFrame:backgroundWindow.frame]; [backgroundWindow addSubview:theMoviPlayer.view]; [theMoviPlayer play]; 但我真的不知道如何将video添加到我的项目。 在哪个文件夹我必须把video文件!? 或者我还需要做些什么来添加到我的项目? 编辑: 它在xcode中看起来像这样,是正确的吗? 因为我现在确实收到播放错误。 以前我用一个url来播放这个video,这工作得很好,但与本地文件不是:(

iOS 5:将3个video与AVAssetExportSession合并时出错

我试图合并(附加)使用AVAssetExportSession 3video,但我不断收到此错误。 奇怪的是1或2个video的工作。 Error Domain=AVFoundationErrorDomain Code=-11820 "Cannot Complete Export" UserInfo=0x458120 {NSLocalizedRecoverySuggestion=Try exporting again., NSLocalizedDescription=Cannot Complete Export} 我什至试图重做function的情况下,但我得到的只是无限的错误信息。 这是我的代码片段。 AVMutableComposition *mixComposition = [AVMutableComposition composition]; AVMutableCompositionTrack *compositionTrack = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; NSError * error = nil; NSMutableArray * timeRanges = [NSMutableArray arrayWithCapacity:arrayMovieUrl.count]; NSMutableArray * tracks = [NSMutableArray arrayWithCapacity:arrayMovieUrl.count]; for (int i=0; i<[arrayMovieUrl count]; i++) { AVURLAsset *assetClip […]

在运行iOS 5.1.1的旧版iPad上,AdHoc安装失败 – / usr / libexec / installd崩溃

我有一个应用程序,我分布使用AdHoc – 工作正常(使用testflightapp.com)在大多数设备上,但是我有两个较旧的分别运行iOS 5.1.1和iOS 4.3和那些我不能得到应用已安装。 该应用程序已经使用XCode 5.1.1和iOS 4.3的部署目标。 安装过程大约75%(即主屏幕上的图标显示,进度指示器开始运行高达约75%),然后显示错误消息:“无法下载应用程序” – …此时无法下载。 检查日志我发现/ usr / libexec / installd崩溃 – 请参阅下文。 顺便说一句,当我尝试通过iTunes安装应用程序,所以它与Testflight无关。 任何暗示,为什么会发生这种情况,我将如何解决它将不胜感激。 帕特里克 Incident Identifier: 55B1E8CF-AF1B-4E2E-9445-9001A1E9181F CrashReporter Key: 2c384f06f249d55ddbb948525a8bef5b10aef496 Hardware Model: iPad1,1 Process: installd [301] Path: /usr/libexec/installd Identifier: installd Version: ??? (???) Code Type: ARM (Native) Parent Process: launchd [1] Date/Time: 2014-08-15 19:45:40.965 +1000 OS Version: […]

从前置摄像头iOS 5.0捕捉时总是看到镜像

从Front摄像头捕捉数据时,我总是得到Mirror镜像,我怎么能在预览窗口中看到我所看到的。 我已经将videoMirrored设置为TRUE 。 以下是代码片段: AVCaptureConnection *lConnection = nil; for ( AVCaptureConnection *connection in [lHandle->m_output connections]) { for ( AVCaptureInputPort *port in [connection inputPorts] ) { if ( [[port mediaType] isEqual:AVMediaTypeVideo] ) { lConnection = connection; break; } } } if ([lConnection isVideoOrientationSupported]) [lConnection setVideoOrientation:AVCaptureVideoOrientationPortrait]; if ([lConnection isVideoMirroringSupported]) [lConnection setVideoMirrored:TRUE]; 将setVideoMirrored更改为True/False也不会更改任何内容( isVideoMirroringSupported返回Success)

UIWebView不使用ARC释放所有活动字节

我目前在使用ARC的iOS 5.1中构build一个导航控制器应用程序。 我经常需要显示网页,我已经做了一个Web浏览器,这只是一个UIWebView与周围的一些自定义内容。 当用户完成查看页面时,他们点击后退button,应释放与自定义Web查看器关联的所有内存。 我的问题是,当后退button被击中时,所有内存都不会被释放。 我已经构build了一个玩具应用程序( 在github上 ),它只是一些button,每个button都有一个第一响应者调用不同的页面。 @implementation ViewController -(IBAction)googlePressed:(id)sender { CustomWebView *customWebView = [[CustomWebView alloc] initWithStringURL:@"http://www.google.com"]; [self.navigationController pushViewController:customWebView animated:NO]; } -(IBAction)ksbwPressed:(id)sender { CustomWebView *customWebView = [[CustomWebView alloc] initWithStringURL:@"http://www.ksbw.com/news/money/Yahoo-laying-off-2-000-workers-in-latest-purge/-/1850/10207484/-/oeyufvz/-/index.html"]; [self.navigationController pushViewController:customWebView animated:NO]; } -(IBAction)feedProxyPressed:(id)sender { CustomWebView *customWebView = [[CustomWebView alloc] initWithStringURL:@"http://feedproxy.google.com/~r/spaceheadlines/~3/kbL0jv9rbsg/15159-dallas-tornadoes-satellite-image.html"]; [self.navigationController pushViewController:customWebView animated:NO]; } -(IBAction)cnnPressed:(id)sender { CustomWebView *customWebView = [[CustomWebView alloc] initWithStringURL:@"http://www.cnn.com/2012/04/04/us/california-shooting/index.html?eref=rss_mostpopular"]; [self.navigationController […]

显示一次login屏幕w /故事板的最佳做法

我在这里看到类似的问题,但没有一个明确的答案。 因此,我有一个模式login视图,其中包括经典的用户名/密码表单,Facebookloginbutton和一个注册button,我想在用户第一次启动应用程序时显示该button。 从我发现有两种方法来实现这一点,以shortcumings。 在AppDelegate的didFinishLaunchingWithOptions中设置一个条件来检查用户是否login。如果不是,则将rootViewController设置为loginViewController。 在成功login之后,会在应用程序的主视图中显示一个细节。 我这个问题的问题是,我不知道如何重置rootViewController到主视图。 这是可能的和如何? 有没有其他的方式来显示login模式而不设置rootViewController? 这意味着我会保持主要观点。 在viewDidAppear中的主视图控制器中,条件检查用户是否login。如果不是执行loginVC的segue。 当用户成功login时,他会返回到解除模态login视图的主视图。 这个问题的问题在于主要的观点被简要地显示出来了,我不想这样做。 任何其他的想法? 请让我知道什么是这种情况下的最佳做法。 先谢谢你,

在iOS 5上放置一个CLPlacemark在地图上

在iOS 5中,有一种新的方式来转发地理编码地址(像美国加利福尼亚州的1无限循环地址转换为经纬度地址)。 更多信息在这里。 有没有人试图把前进的地理编码CLPlacemark对象在MKMapView? 地理编码后,我有一个CLPlacemark对象,但不知道如何把它放在地图上。 我将不胜感激任何forms的帮助。 Google迄今为止没有任何帮助。

iOS – 我收到内存警告,但不知道为什么

我正在开发的iOS和检查我的应用程序与iPhone和iPad。 我收到很多内存警告(didReceiveMemoryWarning被调用),但不知道为什么。 我的应用程序在峰值点使用〜35MB,最低点为4-5 MB。 我试图用“工具”来查找泄漏,但找不到任何关键问题。 有没有一个很好的方法来找出为什么系统发送内存警告?