Tag: iphone

简单的iCloud实现

我创建了一个新的appID并在iTunes Connect上启用了iCloud。 我已从摘要部分启用了应用内的权利。 我已经包含了用于检查iCloud可用性的代码: NSURL *ubiq = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil]; if (ubiq) { NSLog(@”iCloud access at %@”, ubiq); // TODO: Load document… } else { NSLog(@”No iCloud access”); } 我需要做的就是将NSArray保存到云中的方法以及能够下载它的方法。 然而,我很难通过文档来弄清楚它们应该是什么样子。 谢谢您的帮助!!

像ios中删除的效果

我需要在iOS上删除/移动app效果的提示/代码,通常我已经启动了代码,我在UIScroll使用UIButton列表。 所以我的问题是假设我在屏幕上有8到10个按钮,我想通过拖动来改变它们的位置。 例如选择第6个按钮并移动或设置为1到2之间。当我把它们放到其他按钮的位置之间时会改变。 我正在使用UIPanGestureRecognizer进行拖动。

我的NSXMLParser没有解析并返回null

我在其他视图控制器的按钮单击中解析我的xml但现在我已将其更改为app delegate类(我的应用程序是通用应用程序)。 所以,一旦我启动我的应用程序是应该解析all.My解析方法写在另一个ViewController,我从我的appDelegate类调用这些方法,但它返回给我: – NSXMLParser ERROR: The operation couldn’t be completed. (NSXMLParserErrorDomain error 65.) – (null) 不知道我现在做了什么。 任何帮助都会很明显。

简单的日期格式问题yyyymmdd

想知道将像“yyyymmdd”这样的字符串变成格式为“mm-dd-yyyy”的字符串的最佳方法。 尝试NSDateFormatter没有运气。 任何帮助表示赞赏! 我的解决方案如下: NSString *dateString = @”22082011; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@”yyyyMMdd”]; NSDate *date = [dateFormatter dateFromString:dateString]; [dateFormatter setDateFormat:@”MMM d, YYYY”]; dateString = [dateFormatter stringFromDate:date]; [dateFormatter release];

仪器自动化:迭代所有按钮

我正在自动化我的一个应用程序。 首先我点击tabBar => ok 点击导航栏的“添加”按钮=>确定 填写我的tableView => ok的textFields的一些数据 点击某个单元格并打开一个新的ViewController => ok 点击这个新控制器中的“添加”按钮=>没有任何反应…… 该按钮与第一个视图相同:UIBarButtonSystemItemAdd 所以,现在我想显示自动化可以找到的所有按钮,并迭代并获取其名称,只是为了检查一切进展顺利,但我找不到按钮的名称,请参阅: var arr = UIATarget.localTarget().frontMostApp().navigationBar().buttons(); for(var i=0; i<arr.length; i++) { var value = arr[i]; UIALogger.logMessage(value.name); } 我正以同样的方式点击两个按钮: UIATarget.localTarget().frontMostApp() .navigationBar().buttons()[“Add”].tap(); 谢谢, 河 编辑: 好的,按钮点击已使用延迟1解决 但我无法在循环中获取按钮名称,但至少我可以继续使用我的应用程序

自动分页滚动视图

我有个问题。 我想在滚动视图中向用户显示一些内容。 我想从左到右快速自动滚动滚动视图。 我尝试使用DDAutoscrollview(如果有人知道),但它对我不起作用。 有人帮我自动滚动Uiscrollview吗? 我为scrollview设置了一个pagecontrol,因为它使用了分页。 任何代码片段都会很好。 我的代码(Just of the Scrollview): 。H @interface Interface1 : UIViewController { IBOutlet UIScrollView *scroller; } .M – (void)viewDidLoad { [scroller setScrollEnabled:YES]; [scroller setContentSize:CGSizeMake(960, 230)]; [super viewDidLoad]; } 我正在使用Storyboards和ARC。 谢谢

iphone:使用Core Graphics重写GLPaint

我想重写Apple源代码,GLPaint应用程序,但不使用像OpenGL这样的例子,我想使用Core Graphics库。 但我坚持像GLPaint那样展示纹理。 这是我在Core Graphics中的代码: – (void) drawLineFromPoint: (CGPoint) fromPoint toPoint: (CGPoint) toPoint { UIGraphicsBeginImageContext(self.frame.size); CGContextRef context = UIGraphicsGetCurrentContext(); [drawImage.image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)]; UIImage * image = [UIImage imageNamed:@”Particle.png”]; UIColor * color = [UIColor colorWithPatternImage:image]; CGContextSetStrokeColorWithColor(context, color.CGColor); CGContextSetLineCap(context, kCGLineCapRound); CGContextSetLineWidth(context, 5.0); CGContextBeginPath(context); CGContextMoveToPoint(context, fromPoint.x, fromPoint.y); CGContextAddLineToPoint(context, toPoint.x, toPoint.y); CGContextStrokePath(context); drawImage.image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); } […]

Iphone – 在没有UIImagepicker的情况下将图像从相机胶卷加载到UIImageView

是否可以在不使用UIImagepicker的情况下将最后一张照片从相机胶卷加载到UIImageView? 我的意思是检索文件的路径或类似的东西。 谢谢你:D

如何在iphone应用程序开发中的导航栏上的分段控制器中添加下一个和上一个按钮?

我很麻烦….如何在我的分段栏上设置下一个和上一个按钮/箭头…如果有人需要简要介绍我的问题那么请看这个链接… 我怎样才能添加下一个和上一个按钮在分段控制器? 我附上了一张图片来了解这个问题…所以任何人都请帮助我…. 注意:在我当前的项目中,它在分段栏上添加了5个以上的按钮,所以当我按下一个/上一个箭头时,分段栏应该从他的位置移动。如果我的问题不清楚那么请看我的另一个链接…. 提前致谢 编辑: UIBarButtonItem *previousBarButtonItem = [[UIBarButtonItem alloc] //init]; initWithTitle:@”” style:UIBarButtonItemStyleBordered target:self action:@selector(nextBarButtonAction:)]; self.navigationItem.rightBarButtonItem = nextBarButtonItem; [nextBarButtonItem release]; //This Portion For UIToolbar topToolBar = [UIToolbar new]; topToolBar.barStyle = UIBarStyleDefault; [topToolBar sizeToFit]; topToolBar.frame = CGRectMake(50, 410, 280, 50); //Add buttons UIBarButtonItem *systemItem1 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(pressButton1:)]; UIBarButtonItem *systemItem2 = [[UIBarButtonItem alloc] […]

iOS – 推送通知:它始终显示通知

我想知道是否可以通过APNS发送推送通知,如果应用程序未启动则不显示通知? (在这种情况下,收到的消息将被丢弃) 谢谢