Tag: ios 5

在后台线程中运行一个方法后,应用程序崩溃

我正在logging我们可以拖动图像的主屏幕。 我有一个setneedsdisplay方法,减慢拖动的对象。 但是,当我在后台线程调用相同的方法问题已解决,但应用程序崩溃。 另外,如果有没有其他的select来loggingvideo,而不是一次又一次调用drawRect:方法? – (void) drawRect:(CGRect)rect { NSDate* start = [NSDate date]; CGContextRef context = [self createBitmapContextOfSize:self.frame.size]; CGAffineTransform flipVertical = CGAffineTransformMake(1, 0, 0, -1, 0, self.frame.size.height); CGContextConcatCTM(context, flipVertical); [self.layer renderInContext:context]; CGImageRef cgImage = CGBitmapContextCreateImage(context); UIImage* background = [UIImage imageWithCGImage: cgImage]; CGImageRelease(cgImage); self.currentScreen = background; if (_recording) { float millisElapsed = [[NSDate date] timeIntervalSinceDate:startedAt] * […]

一对多的KVO,但传递到observeValueForKeyPath的NSNull对象

我有一个托pipe对象与成员类的一对多关系。 当我添加成员的观察员,它的工作。 当一个新成员添加到关系中时,将使用新对象调用observeValueForKeyPath,并且更改字典包含新成员对象。 但是,obserValueForKeyPath将被第二次触发,所有值为nil并且改变字典new =“NULL”。 什么是第二个触发器? 我设置了一个断点,但不知道谁是触发器。 @interface FooObject : NSManagedObject {} @property (nonatomic, strong) NSString *fooId; @property (nonatomic, strong) NSSet* members; @end @implementation FooObject @dynamic fooId; @dynamic members; – (NSMutableSet*)membersSet { [self willAccessValueForKey:@"members"]; NSMutableSet *result = (NSMutableSet*)[self mutableSetValueForKey:@"members"]; [self didAccessValueForKey:@"members"]; return result; } – (void)registerObservers { [self addObserver:self forKeyPath:@"members" options:NSKeyValueObservingOptionNew context:nil]; } – (void)unregisterObservers […]

当通过xcode5的xibdevise时,导航栏button项目图像的颜色是不同的

我的问题是,我使用XIB创build导航栏button,但是当我要将图像设置为酒吧button,然后图像颜色是不同的作为orignal图像。 这是我的原始形象。 在导航栏button项目上添加该图像之后,看起来像这样

使用Opencv示例从相机保存图像

我已经使用IOS示例中的 代码 。 并试图保存从相机的图像。 问题是,图像正在保存,但蓝色色调如下。 下面是我用来保存图像的代码。 – (void)processImagecv::Mat&image { ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; UIImage * convertedImage = [ViewController imageWithCVMat:image]; [library writeImageToSavedPhotosAlbumconvertedImage CGImage] orientationALAssetOrientation)[convertedImage imageOrientation] completionBlock:^(NSURL *assetURL, NSError *error){ if (error) { // TODO: error handling } else { // TODO: success handling NSLog(@"Success"; } }]; TS(DetectAndAnimateFaces); faceAnimator->detectAndAnimateFaces(image); TE(DetectAndAnimateFaces); }

如何通过分别提供密钥文件来播放m3u8encryption的播放列表?

我有一个m3u8播放列表文件(让我们称之为素数),它指向另一个播放列表文件,该文件又具有带有密钥文件URL的ts URL。 使用MPMoviePlayer我目前可以播放prime m3u8文件。 这些段使用AES-128位encryption进行encryption,密钥文件位于最终的m3u8文件中。 有没有一种方法可以提供最终的m3u8文件,并告诉应用程序使用本地密钥文件来解密video,所以我不必公开发布密钥文件。 这与这个SO问题有些相关