错误编译调整在theos

我在这里使用教程设置了一个简单的调整。 但是,当我从这里运行make头,我得到 Making all for tweak WelcomeWagon… Preprocessing Tweak.xm… Compiling Tweak.xm… In file included from Tweak.xm:1: /opt/theos//include/SpringBoard/SpringBoard.h:7:26: error: UIApplication.h: No such file or directory cc1objplus: warnings being treated as errors In file included from /opt/theos//include/SpringBoard/UIApplicationDelegate-Protocol.h:7, from /opt/theos//include/SpringBoard/SpringBoard.h:9, from Tweak.xm:1: /opt/theos//include/SpringBoard/NSObject-Protocol.h:7: warning: duplicate declaration for protocol 'NSObject' In file included from /opt/theos//include/SpringBoard/SpringBoard.h:9, from Tweak.xm:1: /opt/theos//include/SpringBoard/UIApplicationDelegate-Protocol.h:11: warning: […]

程序化语言本地化,无需重启

我想用英语和阿拉伯语创build一个iPhone应用程序。 我检查了语言切换器的国际化文件,但是要实现这一点,我必须手动去改变iPhone的设置。 我不想这样做。 所以我正在计划在主屏幕上,我将有两个button,如英语和阿拉伯语。 如果用户点击阿拉伯文,我会有阿拉伯文字,如果用户select英文,应用程序将是英文的。 任何想法/build议如何做到这一点? 注意:我不想手动去改变语言。 编辑1 根据@Jano,我在下面做了。 创build新项目。 在本地化中添加阿拉伯语。 现在我有两个故事板和两个InfoPlist.strings文件。 添加Localization.h和.m文件,如答案中所示。 目录结构是MyProject-ar.lproj & MyProject-en.lproj Plist的内容是"myButton01" = "Back"; & "myButton01" = "ظهر"; First View Controller有两个button,分别是英文和阿拉伯文。 在这些button上调用操作。 – (IBAction)pressedEnglish:(id)sender { [Localization sharedInstance].fallbackLanguage = @"ar"; [Localization sharedInstance].preferredLanguage = @"en"; NSLog(@"pressed english"); } – (IBAction)pressedArabic:(id)sender { [Localization sharedInstance].fallbackLanguage = @"en"; [Localization sharedInstance].preferredLanguage = @"ar"; NSLog(@"pressed arabic"); } […]

在Swift中获取图像名称UIImagePickerController

我使用UIImagePickerController从手机库(iOS)中获取图像。 编辑模式后,我把图像到我的UIImageView。 我想将这个图像保存在Core Data中以在另一个View Controller中使用它 我怎么能在Swift中做到这一点。 如果这是不可能的,我必须保存图像有什么select?

AVAudioEngine播放多声道audio

简单的问题。 如何使用AVAudioEngine播放多声道audio文件(> 2声道),以便在默认的双声道输出(耳机/扬声器)上听到所有声道。 以下代码(删除错误检查提交)播放文件的第一个两个渠道,但我只能听到耳机插入时听到。 AVAudioFile *file = [[AVAudioFile alloc] initForReading:[[NSBundle mainBundle] URLForResource:@"nums6ch" withExtension:@"wav"] error:nil]; AVAudioEngine *engine = [[AVAudioEngine alloc] init]; AVAudioPlayerNode *player = [[AVAudioPlayerNode alloc] init]; AVAudioMixerNode *mixer = [[AVAudioMixerNode alloc] init]; [engine attachNode:player]; [engine attachNode:mixer]; AVAudioFormat *processingFormat = [[AVAudioFormat alloc] initWithCommonFormat:AVAudioPCMFormatFloat32 sampleRate:file.processingFormat.streamDescription->mSampleRate channels:2 interleaved:false]; [engine connect:player to:mixer format:processingFormat]; [engine connect:mixer to:engine.outputNode format:processingFormat]; [engine startAndReturnError:nil]; […]

如何杀死/暂停/closuresGCD中的asynchronous块?

我已经实现了一个使用GCDasynchronous调度的块,如下所示: __block BOOL retValue; dispatch_async(dispatch_get_global_queue(0, 0), ^{ retValue = [self GCDHandler:actionName WithServiceType:serviceType :arguments]; }); return retValue; 如果运行时间比我想要的长,我该如何取消这样的模块? 有没有办法取消GCD调度的块,或提供超时?

像UBER一样在Google Map上移动GMSMarker

我正在谷歌地图上开发一些导航任务。 随着车辆在其应用程序中的移动,我必须移动标记。 我已经尝试了@SO提供的不同的解决scheme,但它不能按我的需要工作。 我得到与以前经纬/长与当前纬度/经度和animationmapwithwith旋转的angular度 这里是代码 [CATransaction begin]; [CATransaction setAnimationDuration:2.0]; NSDictionary *data = [[result objectForKey:@"returnData"] objectForKey:@"data"]; if (![data isEqual: [NSNull null]]) { driverLocationCoordinate = CLLocationCoordinate2DMake([[data objectForKey:@"lat"] doubleValue], [[data objectForKey:@"lng"] doubleValue]); driverMarker.position = driverLocationCoordinate; GMSCameraPosition * camera = [GMSCameraPosition cameraWithLatitude:driverLocationCoordinate.latitude longitude:driverLocationCoordinate.longitude zoom:16]; mapHomeView.camera = camera; if ([data objectForKey:@"preLat"] != [NSNull null] && [data objectForKey:@"preLng"] !=[NSNull null]){ if […]

UIActivityViewController或UIDocumentInteractionController与WhatsApp和FB

我需要有Facebook和WhatsApp作为我的图像共享选项。 我已经实现了UIActivityViewController,在那里我可以通过Facebook和UIDocumentInteractionController共享,我可以通过WhatsApp分享。 我不知道如何合并这些东西。 UIActivityViewController: UIActivityViewController *activityViewContoller = [[UIActivityViewController alloc] initWithActivityItems:@[@"Test", image] applicationActivities:nil]; [self presentViewController:activityViewContoller animated:YES completion:nil]; UIDocumentInteractionController: NSString *savePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/whatsAppTmp.wai"]; [UIImageJPEGRepresentation(image, 1.0) writeToFile:savePath atomically:YES]; _documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:savePath]]; _documentInteractionController.UTI = @"net.whatsapp.image"; _documentInteractionController.delegate = self; [_documentInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES]; 我想在一个popover,但我不知道如何实现它。 请提供任何提示? 我已经检查了StackOverFlow问题1 ,但它根本没有帮助我。 我的文件是.wai(对于WhatsApp),所以当我尝试通过FB文件发送它无法打开。 它也显示了所有选项,而我只想要2(FB + WhatsApp)可见。 在StackOverFlow问题2之后,我只能显示FB(工作之一,因为我设置了正常的图像),但不能添加WhatsApp(没有.wai文件,我不知道如何处理UTI)。 有什么办法可以解决这个问题吗?

新手有使用ASIHTTPRequest上传文件的问题

我真的可以真的使用一些帮助。 我已经在使用ASIFormDataRequest进行照片上传的过程中查找了一些详细的文档(傻瓜)。 有人能通过我在这里的生活线吗? 这是什么(相关部分),虽然我知道我可能会离开。 Camera.h #import <UIKit/UIKit.h> @class ASIFormDataRequest; … Camera.m #import "Camera.h" #import "ASIHTTPRequest.h" #import "ASIFormDataRequest.h" … – (void)uploadImage:(NSData *)imageData filename:(NSString *)filename{ NSURL *url = [NSURL URLWithString:@"http://moosesightings.com/test.php"]; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; // Upload a file on disk [request setData:imageData withFileName:filename andContentType:@"image/jpeg" forKey:@"userfile"]; [request setDelegate:self]; [request startAsynchronous]; } … – (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary […]

PFFile内的图像将被上传到parsing,而不是被保存到本地数据存储

我使用了parsing框架(1.6.2)的swift。 我正在将数据存储到本地数据存储中。 数据由几个string和一个图像组成。 这个图像将存储在一个PfFile中,然后将被添加到PfObject中。 现在我想知道为什么图像不能保存,直到我注意到我需要调用PFFile的save()方法。 问题是,图像似乎上传到我不想要的parsing。 我希望它被存储在本地设备上.. 有这个解决scheme吗? 谢谢 编辑: 代码的工作原理是这样的: var spot = PFObject(className: "Spot") let imageData = UIImageJPEGRepresentation(spotModel.getPhoto(), 0.05) let imageFile = PFFile(name:"image.jpg", data:imageData) spotObj.setObject(spotModel.getCategory(), forKey: "category") spotObj.setObject(imageFile, forKey: "photo") //if I simply would do this, the PFObject will be saved into the local datastorage, but the image won't be saved spotObj.pin() //if […]

如何用单指旋转和调整图像视图

我正在开发一个应用程序,它具有通过拖动右下angularbutton来调整和旋转图像视图的function。 我看到一个应用程序有一个function,如果我们拖动右下angularbutton对angular图像视图大小已resize,否则,如果我们拖动button的左侧或右侧的方向imageview已按方向旋转。 我希望在我的应用程序中实现此function 我正在努力实现单指旋转以及调整imageview的大小。 我可以通过拖动它的右下angularbutton来成功实现调整图像视图的大小。 但我没有足够的知识将旋转添加到图像视图 请引导我正确的方式。 我已经添加了下面的代码,通过拖动它的右上angular来调整图像视图的大小。 – (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [[event allTouches] anyObject]; touchStart = [[touches anyObject] locationInView:imageView]; isResizingLR = (containerVw.bounds.size.width – touchStart.x < kResizeThumbSize && containerVw.bounds.size.height – touchStart.y < kResizeThumbSize); } – (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ CGPoint touchPoint = [[touches anyObject] locationInView:imageView]; CGPoint previous=[[touches anyObject]previousLocationInView:imageView]; UITouch *touch = […]