Tag: ipad

用Unity编写XML文件到iOS(使用C#)

我正在尝试在iOS上写入XML,但似乎是不可能的。 尝试了几个不同的这个,但没有工作。 我已经阅读,iOS只有写/访问它的/ Documents文件夹,所以我试图设置一个Application.dataPath到Documents文件夹。 但是我在Xcode中得到这个错误: DirectoryNotFoundException: Could not find a part of the path "/Users/mariusmathisen/Library/Application Support/iPhone Simulator/7.1/Applications/6AE4AF70-EFDF-46F0-9947-5C0936F3AD27/DaXml.app/Data/Documents/gamexmldata.txt". 这是我写入XML的代码: lic void WriteToXml() { Debug.Log ("Du nådde metoden"); //string filepath = Application.dataPath + @"/Data/gamexmldata.xml"; XmlDocument xmlDoc = new XmlDocument(); GameControl.control.outputXml = "Du nådde WriteXML"; if(File.Exists(Application.dataPath + "/Documents/gamexmldata.txt")) { Debug.Log("Filen Fantes"); GameControl.control.outputXml = "DU ER I Writetoxml og […]

通过layoutSubviews => UIAlertButton类未find自定义UIAlertButton

我试图使用本教程实现自定义警报视图。 所有在这个啧啧啧啧啧啧啧啧啧啧啧but but的,但它并没有谈到定制UIAlertButton 然后,我试图通过layoutSubviews方法来定制它: – (void)layoutSubviews { for (UIView *subview in self.subviews){ //Fast Enumeration if ([subview isMemberOfClass:[UIImageView class]]) { subview.hidden = YES; //Hide UIImageView Containing Blue Background } if ([subview isMemberOfClass:[UILabel class]]) { //Point to UILabels To Change Text UILabel *label = (UILabel*)subview; //Cast From UIView to UILabel label.textColor = [UIColor colorWithRed:210.0f/255.0f green:210.0f/255.0f blue:210.0f/255.0f alpha:1.0f]; […]

如何检查数组值在另一个数组中不存在

我有两个不同的NSMutabelArray ArrOne和ArrTwo。 Letsay ArrOne = A,B,C和D ArrTwo = C,D,X和Y.所以我需要检查ArrTwo的值是否与ArrOne相同,如果ArrTwo与ArrOne不一样, 在这种情况下,我必须从ArrTwo中删除X和Y. 请给我一个主意。

使用Sprite Kit的硬件特定地图集在iPad上被炸毁

从WWDC 2013观看503“使用Sprite Kitdevise游戏”,他们说纹理地图集的好处之一就是您只需要将文件夹拖放到XCode,并为不同设备(OSX,iPhone,iPhone)生成特定于硬件的地图集视网膜,iPad …) 那是对的吗? 我正在删除一个包含精灵animation帧的文件夹,尽pipe它在iPad 2和iPad视网膜上显示的尺寸相同,但它的尺寸是正确尺寸的两倍,当然,在iPad视网膜中图像也是像素化的。 我究竟做错了什么?

如何从颜色select器方法设置button的颜色?

我在for循环中生成了一些button,每个button都有自己的标签。 现在我想点击一个button并打开一个颜色select器并设置button的颜色。 我的问题是,当我打开颜色select器,并select一种颜色,它被设置在不同的button。 我想点击一个button,只select点击button的颜色。 我使用的代码是: for(int i=0;i<=5;i++){ btnphoto=[[UIButton alloc]initWithFrame:CGRectMake(10,(30*i)+110,50,20)]; [btnphoto setTitle:@"Photo" forState:UIControlStateNormal]; [btnphoto setBackgroundColor:[UIColor redColor]]; [btnphoto addTarget:self action:@selector(buttonPressPickColor:) forControlEvents:UIControlEventTouchUpInside]; btnphoto.tag=100 + i; [self.view addSubview:btnphoto]; } -(IBAction)buttonPressPickColor:(UIButton*)sender { btnphoto.tag = sender.tag; NSLog(@"Btn photo Tag = %d",sender.tag); NEOColorPickerViewController *controller = [[NEOColorPickerViewController alloc] init]; controller.delegate = self; controller.selectedColor = self.currentColor; controller.title = @"Color Picker"; UINavigationController* navVC = [[UINavigationController […]

准备出售的应用程序不能find没有iTunes连接

我已经上传了一个应用程序到苹果应用程序商店,其状态显示准备出售,我可以查看它从iTunes连接与应用程序商店查看,但是当我search它,我找不到它。 它应该适用于所有领土,所以来自任何国家的任何帐户都可以。 另外,当我通过iTunes查看时,我购买了它,在我的iPhone上显示在“我的购买”列表中,当我点击以显示应用程序信息时,它会一直加载。 到底是怎么回事?

使用NSCoding存档UIImageView

我从来没有使用NSCoding,我很困惑如何实施。 我目前的iPad应用程序有一个UIImageView(称为“背景”),这是我的主视图控制器的属性。 “背景”有一个UIImage“图像”属性(显然)和用户添加的各种子视图。 添加的子视图是我自己的UIImageView的自定义子类。 我需要能够保存“背景”UIImageView的状态,以便可以恢复与存档时相同的图像和所有子视图。 我知道UIImageView符合NSCoding协议,但我不知道在哪里实现encodeWithCoder和initWithCoder。 我从我的主视图控制器调用这些吗? 我是否需要为UIImageView创build一个类别,使我可以重写这些方法? 我是否需要编写代码来存档我的“背景”UIImageView及其子视图的每个属性? 我已经读过其他地方,因为UIImage不符合NSCoding所以需要分类或添加一个类别,以便能够存档UIImageView。 我以为会有一个简单的方法来保存磁盘的一个对象,包括所有的属性,子视图等。似乎有很多事情需要做,以便我保存这个“背景”UIImageView并在以后恢复。 我努力想象我需要做的一切。 任何指针非常感谢!

iOS 6中的UIImagePickerController无法正常工作

我有一个非常奇怪的行为: 在iOS 5中,我以这种方式呈现UIImagePickerController : imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.modalPresentationStyle = UIModalPresentationFullScreen; imagePicker.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentModalViewController:imagePicker animated:YES]; 现在在iOS 6中,这会导致崩溃。 我通过在UIImagePickerController上编写一个类来解决崩溃问题: @implementation UIImagePickerController (NonRotating) – (BOOL)shouldAutorotate { return NO; } – (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation { return UIInterfaceOrientationMaskPortrait; } – (NSUInteger)supportedInterfaceOrientations { return UIInterfaceOrientationMaskAll; } @end 问题是,现在的UIImagePickerController不旋转,它显示正面。 而且,当我按下“取消”button,选取器被解雇,应用程序再次崩溃。 如果我在UIPopoverController使用UIImagePickerController ,所有工作正常(属于UIPopoverController不旋转的事实),但是当我closures在我的应用程序的popup窗口所有视图控制器停止响应旋转事件 ,这导致所有的应用程序被阻止在这个方向。 要恢复正确的行为,我需要从后台退出应用程序,然后再次打开。 这是我用来显示popover的代码 _cameraPopoverController = [[UIPopoverController alloc] initWithContentViewController:imagePicker]; [_cameraPopoverController presentPopoverFromRect:_takeFromCamera.frame […]

VideoJS:不在IOS上工作

我使用了videojs,它可以在所有浏览器(包括IE)和Android上正常工作。 但它不是在iOS设备上工作(iphone和ipad IOS版本6)。 这里是我用来将video添加到页面的代码。 <video id="video1" class="video-js vjs-default-skin" width="276" height="153" controls="" preload="auto" data-setup="{}"> <source src=myvideo.mp4 type="video/m4v" > </video> 我花了很多年,找不到任何解决办法。 我使用video.js版本3.2.0并永远获得加载微调。 我尝试使用版本4,只是黑屏出现。 请任何帮助。

Xcode Instruments中的总字节数达到1 GB是好的吗?

这是我的问题。 我试图用xcode中的Instruments来检查我的分配部分。 我正在做一些图像裁剪应用程序使用CGImageSourceCreateThumbnailAtIndex处理图像。 在做这个过程时,它占用了大量的内存,并且以正确的方式释放它。 在仪器中, 实时字节为1.56Mb, #living = 22,862, 总字节数达到1.11Gb,之后也会增加。 此应用程序不工作在ipad1。 我没有ipad2或3手来testing应用程序。 在图像中有一些高峰点在那里。 那时Live Bytes达到了73MB。 它会被释放。 ipad 2会处理这个高峰? 任何人都可以告诉这将导致设备中的任何内存问题。 整个字节如何? 这有什么限制吗?