Tag: 目标C

不能通过点击UITextVIew中的邮件链接显示MFMailComposeViewController(iOS 8 beta bug)

这原来是由于在iOS 8testing版中的错误。 我已经通过错误号17318153报告 我正在设置一个电子邮件地址到UITextField。 目的是让iOS看到它的一个电子邮件地址,如果用户点击它,显示一个MFMailComposeViewController的实例发送一个电子邮件(它)。 但是,如果用户点击取消, MFMailComposeViewController不会被解雇。 我试图设置我的viewController作为MFMailComposeViewControllerDelegate和覆盖mailComposeController: didFinishWithResult: error:但它没有被调用。 表面上看,当点击url时显示的MFMailComposeViewController的委托没有被设置为self。 如何使MFMailComposeViewController的取消button实际上closures显示的视图控制器? 我的.h: #import <UIKit/UIKit.h> #import <MessageUI/MessageUI.h> @interface AboutUsViewController : UIViewController<MFMailComposeViewControllerDelegate>{ IBOutlet UIImageView *imageView; IBOutlet UITextView *companyName; IBOutlet UITextView *phoneNumber; IBOutlet UITextView *emailAddress; IBOutlet UITextView *aboutUsField; } @end 在.m中: – (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. emailAddress.text=@"support@email.com"; } […]

iOS崩溃日志堆栈跟踪的C#部分没有任何意义

我有一个崩溃日志文件,我用二进制文件中的信息符号化 。 我validation了崩溃日志与这个特定的二进制文件有关 。 我甚至能够脱离C#级堆栈跟踪: $atos -arch armv7 -o 'dev.app'/'dev' 0x00156ac0 m_Action_Spin_MakeChips_Cell_double_double_ulong_System_Collections_Hashtable_System_Collections_Generic_List_1_Chip (in dev) + 1316 但是,我得到的堆栈跟踪没有任何意义! 这些方法不会互相呼叫,也不相关。 可能是有一些中间的堆栈跟踪帧丢失? 这种方式在我的代码中可能是有意义的。 更新 我已经注意到一个非常奇怪的事情,我有两个崩溃日志。 testing人员对两种testing都描述了相同的情况。 其中一个看起来像这样: 0 dev 0x00cbff6c 0x7c000 + 12861292 1 dev 0x00bd4810 0x7c000 + 11896848 2 dev 0x01379838 0x7c000 + 19912760 3 dev 0x0141ba70 0x7c000 + 20576880 4 dev 0x0141bbf4 0x7c000 + 20577268 5 […]

如何在UIImageView中从左向右创buildanimation淡入淡出(alpha渐变)

如何从左到右在UIImageView中创buildanimation淡入淡出。 从左到右我的意思是alpha渐变,不能从左到右移动。 谢谢你的帮助 喜欢这个

有什么办法来知道哪个集合视图单元格在特定点?

我有一个CGPoint,我想知道我的集合视图中的哪个单元格当前包含该点。 有没有简单的方法来做到这一点,或者我必须写我自己的方法?

如何使用segue导航?

我必须导航到button点击使用segue下一个屏幕,但条件是我打电话给一个Web服务,如果从Web服务的结果是成功的,它应该导航,否则停留在login屏幕。 但使用下面的代码,它只是导航.. -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ if([[segue identifier] isEqualToString:@"loginbutton"]) { [self.sharedController setLoginDetailsDyanamic1:_strUsername.text password:_strPassword.text delegate:self]; if ([[dictresult objectForKey:@"Response"] isEqual: @"Success"]) { DashBoardViewController *obj = [[DashBoardViewController alloc]init]; [self.navigationController pushViewController:obj animated:YES]; } } } //delegates -(void)controllerDidFinishLoadingWithResult:(id)result; { dictresult = result; NSLog(@" result —– :%@",dictresult); NSLog(@" result of key—– :%@",[dictresult objectForKey:@"Response"]); // if ([[result objectForKey:@"Response"] isEqual: @"Success"]) // { // […]

在iOS上从OpenCV ProcessImage方法更改标签文本

我正在使用OpenCV在iOS平台上处理video。 题: 不过,我不能用ProcessImage方法更改UIViewcontroller上的UILabel上的文本。 有没有办法做到这一点或调用一个函数?

为什么我的Coregraphics绘图代码造成滞后?

我正在为iPhone绘制应用程序。 它在iPhone模拟器的5秒内工作正常,但随着越来越多,我得出它更加滞后。 当我在设备上testing时,它会变得更加迟钝,我甚至无法画出一棵简单的树。 当我检查处理器在xcode上的运行百分比时,通常在97-100%之间。 有没有什么办法解决这一问题? (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; currentPoint = [touch locationInView:self.view]; UIGraphicsBeginImageContext(CGSizeMake(320, 568)); [drawImage.image drawInRect:CGRectMake(0, 0, 320, 568)]; CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound); CGContextSetLineWidth(UIGraphicsGetCurrentContext(), 5.0); CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 0, 1, 0, 1); CGContextBeginPath(UIGraphicsGetCurrentContext()); CGPathMoveToPoint(path, NULL, lastPoint.x, lastPoint.y); CGPathAddLineToPoint(path, NULL, currentPoint.x, currentPoint.y); CGContextAddPath(UIGraphicsGetCurrentContext(),path); CGContextStrokePath(UIGraphicsGetCurrentContext()); [drawImage setFrame:CGRectMake(0, 0, 320, 568)]; drawImage.image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); […]

在Objective-C中从主类调用方法

我做了定时器的function,如果用户不能在屏幕上触摸10分钟,然后我的应用程序直接进入login屏幕。 对于上面的问题,我使用示例代码从这里https://github.com/B-Sides/ELCUIApplication在类的命名做一些改变,所以我的class是PB_TIMER_UIApplication而不是ELCUIApplication 。 我在main.m类中调用了PB_TIMER_UIApplication类,它的实现如下, return UIApplicationMain(argc, argv, NSStringFromClass([PB_TIMER_UIApplication class]), NSStringFromClass([AppDelegate class])); 我将principalClassName设置为PB_TIMER_UIApplication 现在我在PB_TIMER_UIApplication创build一个属性和实例方法,如下所示, @interface PB_TIMER_UIApplication : UIApplication{ NSTimer *_idleTimer; } @property(nonatomic) int timerTimeOutIntervals; – (void)resetIdleTimer; 现在,我希望我的应用程序在login屏幕/超时会话之前显示警报。 如果提示button按下确定,然后我的计时器再次启动10秒。 那为什么我为timerTimeOutIntervals创build一个属性,以及我想在整个应用程序中调用的属性和resetIdleTimer实例方法。 所以我试图访问属性/方法像Appdelegate调用, [[PB_TIMER_UIApplication sharedApplication] setTimerTimeOutIntervals:10]; 但它显示我静态错误, 我的问题,我错了,以及如何从原则类调用实例方法的属性?

用多个buttonUITableview CommitEditingStyle?

如何添加多个button在UITableview提交编辑风格,我需要显示更多的button与删除button。

本地电话通知

我应该如何继续检测电话是否处于活动状态,无论应用程序是在后台还是在前台,以便在有人打电话时向用户发送本地通知? 我使用此代码来检测电话是否处于活动状态 #import <CoreTelephony/CTCallCenter.h> CTCallCenter * callCenter = [[CTCallCenter alloc] init]; if([callCenter currentCalls] ) { NSLog(@"phone call"); } 我使用一个设备来testing应用程序。