Tag: uialertview

UIAlertview委托方法不在子视图控制器中调用

我有两个控制器 VC A – > Parent和VC B – > Child 警报视图委托方法即 func alertView(View: UIAlertView!, clickedButtonAtIndex buttonIndex: Int){} 在VC A声明。 当我显示来自VC B警报委托方法不会被警告button点击调用。

警告:wait_fences:未能收到回复:10004003

我有时得到这个警告“wait_fences:未能收到回复:10004003”,不知道为什么这是未来, 我没有viewdidiappear方法在我的代码中,我有一个UIAlert在我看来,代码是 UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Start" message:[NSString stringWithFormat:@"Hi %@,",[user objectAtIndex:0] ] delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil]; [alert show]; [alert release];

UIAlertView键盘覆盖textview问题

我发现这个代码: CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0.0, 130.0); [myAlertView setTransform:myTransform]; 但似乎要把我的戒备提高到顶端。 如何将警报视图移到顶端? 设置框架也没有帮助。 alerView.frame = rect;

显示来自非UI类的警报

我在我的应用程序中使用Alamofire,并希望在请求出现错误(例如错误的URL)时显示警报等。 我有这个函数在一个单独的类中,因为它在应用程序的页面之间共享。 Alamofire.request(.GET, api_url) .authenticate(user: str_api_username, password: str_api_password) .validate(statusCode: 200..<300) .response { (request, response, data, error) in if (error != nil) { let alertController = UIAlertController(title: "Server Alert", message: "Could not connect to API!", preferredStyle: UIAlertControllerStyle.Alert) alertController.addAction(UIAlertAction(title: "Dismiss", style: UIAlertActionStyle.Default,handler: nil)) self.presentViewController(alertController, animated: true, completion: nil) } } 由于Alamofireasynchronous工作,我需要做错误检查然后(除非你build议否则),因为那么我想操纵结果,如果URL是错误的,那么它可以变得混乱。 毫不奇怪的 self.presentViewController(alertController, animated: true, completion: nil) […]

OBJ。 C – QR阅读应用程序运行速度太慢

我在这个网站上通过教程(Appcoda的教程),用AVFoundation制作了一个QR码阅读应用程序。 阅读QR码后,该应用程序显示一个UIAlertView。 但是花了近2分钟(有时超过3分钟)。 我将在这里粘贴整个ViewController.m文件。 我希望这已经足够了。 (UIAlertView在captureOutput方法中) // // ViewController.m // Yuvio // // Created by İhsan Batuğhan YILMAZ on 29/08/15. // Copyright © 2015 Farabius. All rights reserved. // #import "ViewController.h" #import <AVFoundation/AVFoundation.h> @interface ViewController () @property (nonatomic) BOOL isReading; @property (nonatomic, strong) AVCaptureSession *captureSession; @property (nonatomic, strong) AVCaptureVideoPreviewLayer *videoPreviewLayer; -(BOOL)startReading; -(void) stopReading; @end @implementation […]

通过UIAlertView显示UIActionSheet

对于特定的服务器通知,我应该显示一个UIActionSheet。 但这里的问题是,当这个事件来了,同时,如果有任何UIAlertView已经显示在任何视图控制器上,它使UIActionSheet禁用(按下确定的警报视图,我不能够select视图控制器上的任何东西,视图被禁用,因为的UIActionSheet)。 任何人都面临这样的问题,任何想法如何解决? 我已经试图在显示操作表之前closures警报视图,但是我需要closures哪个警报视图,因为在许多控制器中有许多警报视图。 所有这些控制器都是本地的。 如何解决这个问题呢。 注意:同样的问题不会出现在iPod上,因为在回复UIActionSheet之前,不会允许点击确定。

在UIAlertView中显示推送通知的内容

您好我目前正在开发一个应用程序,我已经推动通知激活。 我使用parse.com。 我已经得到它的工作到目前为止,我可以发送通知,设备收到它,我也得到了应用程序的徽章。 我从通知中input应用程序时设置了一个AlertView。 但我不知道如何在UIAlertView中显示推送通知的文本。 而且我也希望徽章在您查看邮件时消失。 这里是代码Im使用: – (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { if (application.applicationState == UIApplicationStateInactive) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title" message:@"Text" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil]; [alert show]; } else if (application.applicationState == UIApplicationStateActive) { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Title" message:@"Text" delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil]; [alert show]; } } – (BOOL)application:(UIApplication […]

Xcode显示UITableRowSelection后的UIAlertView?

这是我的第一个问题,对不起,如果有什么不对 那么我想创build一个视图,我可以从表视图中select一个朋友,然后它应该说一个UIAlertView的数量和邮件,但我不知道如何做这个朋友列表是从一个XML文件在我的网站上,然后parsing一个表格上显示一个自定义的单元格devise 这是创build每个单元格的代码 – (UITableViewCell *)tableView:(UITableView *)myTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell = (UITableViewCell *)[self.messageList dequeueReusableCellWithIdentifier:@"ContactListItem"]; if (cell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"ContactListItem" owner:self options:nil]; cell = (UITableViewCell *)[nib objectAtIndex:0]; } NSDictionary *itemAtIndex = (NSDictionary *)[messages objectAtIndex:indexPath.row]; UILabel *userLabel = (UILabel *)[cell viewWithTag:2]; userLabel.text = [itemAtIndex objectForKey:@"user"]; return cell; } 感谢圣地亚哥

UIAlertview exc_bad_access

我添加了一个函数来closuresUIAlertView几秒钟后。整个代码是这样的: – (void)netWorkAlert { UIAlertView *netWork = [[UIAlertView alloc] initWithTitle:@"error" message:@"network has problems" delegate:self cancelButtonTitle:nil otherButtonTitles: nil]; [netWork show]; [self performSelector:@selector(dismissAlert:) withObject:netWork afterDelay:2]; } – (void)dismissAlert:(UIAlertView *)alert { if(alert) { [alert dismissWithClickedButtonIndex:0 animated:YES]; [alert release]; } } networking不可用时调用netWorkAlert 。 现在我遇到的问题是当第二次调用netWorkAlert时,应用程序被破坏,Xcode显示错误 int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([ZJAppDelegate class])); //Thread […]

如何在validation后closures警报视图?

我已经使用SCLAlertView用于forgot password在这个我已经放置了一个textfield SCLAlertViewinputemail ,使成功validation后只需要隐藏没有这个它不应该隐藏任何人都可以帮助我如何实现这一点? 我的代码如下所示 @IBAction func forgetPasswordButton(_ sender: Any) { let appearance = SCLAlertView.SCLAppearance(showCloseButton: true) let alert = SCLAlertView(appearance: appearance) let txt = alert.addTextField("Enter your emailid") _ = alert.addButton("Submit", action: { let action = txt.text print(action as Any) }) if(txt.text?.isEmpty)! == true{ }else{ } _ = alert.showEdit("Forgot Password", subTitle:"Please enter your email address below.You […]