更改推送通知声音

如何使用自定义声音进行推送通知? 根据我的研究和阅读,我发现有效载荷应该具有应用程序包中或应用程序数据容器的Library / Sounds文件夹中的文件名。 如何把文件放在那里?

如何在iOS中获取个人热点的子网掩码和广播地址

我需要find一个方法来找出我的个人热点在iOS的子网掩码和广播地址。 如果连接到WiFi,我正在使用以下方法查找设备的IP地址。 但是无法弄清楚获取个人热点的networking属性的方法。 + (NSString *) localIPAddress { NSString *address = @"error"; struct ifaddrs *interfaces = NULL; struct ifaddrs *temp_addr = NULL; int success = 0; // retrieve the current interfaces – returns 0 on success success = getifaddrs(&interfaces); if (success == 0) { temp_addr = interfaces; while(temp_addr != NULL) { // check if interface […]

UISearchController不能在旋转时重新显示导航栏

我已经实现了UISearchController,它工作的很好,除了… 当我点击search栏时,导航栏就像预期的那样很好地消失了。 当我将手机旋转到横向视图时,我可以得到这个有意义的视图。 但是,当我将手机旋转回纵向视图(仍在searchtypes区域中select)时,我会看到下面的视图。 你可以看到导航栏不会再出现。 我觉得我正在实施一个基本的search控制器。 什么可能导致这个? self.venueSearchController = [[UISearchController alloc] initWithSearchResultsController:nil]; self.venueSearchController.searchResultsUpdater = self; self.venueSearchController.searchBar.delegate = self; self.venueSearchController.dimsBackgroundDuringPresentation = NO; self.venueSearchController.hidesNavigationBarDuringPresentation = YES; self.venueSearchController.searchBar.frame = CGRectMake(self.venueSearchController.searchBar.frame.origin.x, self.venueSearchController.searchBar.frame.origin.y, self.venueSearchController.searchBar.frame.size.width, 44.0); self.definesPresentationContext = YES; self.navigationController.navigationBar.translucent = YES; self.venueSearchController.searchBar.translucent = YES; self.tableView.tableHeaderView = self.venueSearchController.searchBar;

如何使用ios的blob存储服务?

在我的应用程序中,我需要使用Windows Azure服务来存储我正在使用的数据: http : //www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-data-从我的应用程序的Windows Azure集成ios / sdk。 现在我需要将图像上传到Azure,为此,我使用的是同一个sdk …但后来我发现在Windows Azure上正确的位置上传更大的图像是Blob存储客户端。 在.Net他们有不同的库,我发现这个链接http://www.windowsazure.com/en-us/develop/net/how-to-guides/blob-storage/上传图像blob存储。 但是我怎么能用Objective C做到这一点呢? 经过一番研究,我发现这个链接http://www.deviantpoint.com/post/2012/02/18/Using-Azure-Storage-Services-from-an-iPhone-App-Part-1-Table-and-Blob -setup-Azure-iOS-toolkit-and-Model-Classes.aspx,但不清楚如何上传图片并获取图片url的回应?

裁剪UIImage到alpha

我有一个相当大的,几乎全屏的图像,我将要在iPad上显示。 图像是大约80%透明。 我需要,在客户端上,确定不透明像素的边界框,然后裁剪到该边界框。 在StackOverflow上扫描其他问题,并阅读一些CoreGraphics文档,我想我可以通过以下方式实现: CGBitmapContextCreate(…) // Use this to render the image to a byte array .. – iterate through this byte array to find the bounding box .. CGImageCreateWithImageInRect(image, boundingRect); 这看起来非常低效和笨重。 有没有什么聪明的我可以用CGImage的面具或使用设备的graphics加速来做到这一点?

确定CGPoint是否在图像区域内

我试图弄清CGPoint是否在图像的形状之内。 图像是一个简单的黑色形状,如下面的两个附件。 我想创build一个方法来确定CGPoint是否位于该形状的黑色区域内。 我认为这需要两件事:1)将图像转换成可以用代码读取的东西(不知道这将使用什么样的image processing或如何) 2)以此作为参考来确定CGPoint是否在其中。 任何帮助或想法表示赞赏。 我从来没有做过image processingtypes的编码。 谢谢!

iOS 8的YouTubevideoembedded

我面临着我似乎无法理解的问题。 我有这个代码在iOS 7的Xcode 5中完美的工作: – (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. CGFloat width = self.view.frame.size.width; CGFloat height = self.view.frame.size.height; UIWebView *webview = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, width, height)]; NSString* embedHTML = @"\ <html><head><meta name=\"viewport\" content=\"width=device-width; initial-scale=1.0; user-scalable=0;\"/>\ <style type=\"text/css\">\ body {\ background-color: transparent;\ color: […]

如何在iOS应用程序中使用Stripe Connect

有没有人有成功使用条纹连接与iOS应用程序。 我有几个问题: 我遵循这里的指导: https : //stripe.com/docs/connect/getting-started 注册应用程序:容易,没有问题 然后再往下看: 发送你的用户到Stripe:再次,容易没有问题在这里,我只是有一个button,在UIWebView中打开链接。 我认为在URL中的client_id是好的? 我的很多不确定因素是我应该硬编码到应用程序中的ID /密钥 然后再往下看: 用户连接或创build一个Stripe帐户后,我们会将它们redirect回到您在应用程序设置中使用代码参数或错误设置的redirect_uri。 我在这里做的是使用UIWebview的webView:shouldStartLoadWithReqest:navigationType委托方法来检查URL中的string“code =”。 如果发现,那么我可以抓住“代码”参数。 所以现实中,redirect_uri对我来说完全没有必要。 这是处理这个问题的正确方法吗? 我应该在我的应用程序或我的服务器上做这个吗? 收到代码后,我们应该进行POST调用来接收access_token。 同样,这应该在应用程序内还是在服务器上完成? 它需要使用一个secret_key,所以我猜服务器? 如果需要将令牌发送到服务器,我该如何发送信用卡信息以及此令牌? 我知道如何获得卡号,有效期和CVV。 但是就传递给服务器而言(有或没有令牌)是我不确定的。 然后,当涉及到实际上在服务器上编写PHP,Ruby或Python代码时,我完全不知所措。 任何帮助将不胜感激。

UIAlertController / UIAlertView在iOS 8上滚动

我想知道是否有人知道UIAlertViews和UIAlertControllers不会在iOS 8上滚动的事实的一个很好的解决scheme? 这里是一个例子: [[[UIAlertView alloc] initWithTitle:@"Test" message:@"long string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\nlong string\n long string\nlong string\nlong string\nlong string\nlong string\nlong string\n long string\nlong string\nlong string\nlong string\nlong string\nlong string\n" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil] […]

Swift / iOS:如何在AnyObject / Any或Pointers的函数中使用inout参数

我试图编写一个函数,它需要一个variables指针和一个描述符/键,并为variables设置一个新的值。 理想情况下,指针应该是一个对象或一个原语,但我也可以使用单独的函数(或附加参数)。 在我的代码中,我也使用键从数据库中检索新值,但在下面的示例中,我使用虚拟值对其进行了简化,以便在操场中轻松使用它: import UIKit func setValue(inout object: AnyObject, key: String) { switch key { case "String": object = "A String" case "UIColor": object = UIColor.whiteColor() case "Bool": object = true default: println("Unhandled key: \(key)") } } var string: String = "Default String" var color: UIColor = UIColor.blackColor() var bool: Bool = false setValue(&string, "String") […]