如何testingApple推送通知反馈服务?

我做的一个testing是: 我做了一个示例应用程序,我启用了推送通知并实现了处理它们的机制。 我正在testing发送无声的推送通知到我的应用程序curl ,这工作得很好。 我正在testing: curl -v -d'{“aps”:{“content-available”:1}}'–cert“/Users/me/Desktop/mycert.pem”:“”-H“apns-topic:com.domain .name“–http2 https://api.development.push.apple.com/3/device/XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 作为苹果的回答,我总是看到以下内容: <HTTP / 2.0 200 <apns-id:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX 根据官方文档的Table 6-4 ,这是正确的,正如所料: https : //developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html 现在我从我的设备中删除应用程序,然后重试相同的请求,希望能够开始获取状态码410和信息: The device token is no longer active for the topic 。 如何,这不会发生,我总是得到200状态代码就像一切正常,并推动令牌仍然可用。 删除后的1 – 1.5小时,我仍然得到200作为答案。 你也许知道苹果刷新令牌清单的频率有多高?我什么时候能期望最终开始获得410 ? 而且 – 在testing生产环境之外的应用程序时,可以testing410状态(通常是Instant Feedback )吗? 预先感谢任何一种答案。 干杯

带图像和标题的UISegmentedControl

我正在使用一个UIToolBar内的UISegmentedControl作为button。 我不能使用正常的UIButtonBarItem ,因为我需要设置tintColor并支持iOS 4.3。 所以我使用下面的代码: UISegmentedControl* searchButton = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:@"", nil]]; [searchButton setImage:[UIImage imageNamed:@"search_picto"] forSegmentAtIndex:0]; searchButton.momentary = YES; searchButton.segmentedControlStyle = UISegmentedControlStyleBar; searchButton.tintColor = [UIColor colorWithRed:0.27 green:0.60 blue:0.20 alpha:1.00]; [searchButton addTarget:self action:@selector(actionSearch:) forControlEvents:UIControlEventValueChanged]; 这很好,但有没有一种方法可以在我的图像旁边显示文本/标题? 方法setTitle:删除图像。 必须有另一种方式 谢谢你的帮助。 – 编辑:我决定直接添加文本到UIImageView像这样: NSString* label = @"My Label"; UIImage* image = [self addText:label toImage:[UIImage imageNamed:@"icon"]]; [_segmentedControl insertSegmentWithImage:image atIndex:0 […]

在OpenGL ES 2.0中进行抗锯齿?

有没有办法在OpenGL ES 2.0中实现Anitaliasing技术? 我已经看到了,发现了很less的方法,但是输出没有变化。 在最坏的情况下,我已经计划实现多遍渲染,通过显示每个像素周围的像素的平均颜色来平滑片段着色器中的边缘,但是它会花费更多的GPU性能。 有什么build议么 ?

目标C到Swift代码转换,似乎无法正确处理在Swift中的字节

我正在研究一个简单的Swift蓝牙心率监视器iOS应用程序。 我发现这个具有客观的C代码的伟大的教程。 我已经将其转换为Swift,并从我的心率监视器获取数据。 我的问题是,我似乎无法正确访问和转换在Swift中的字节数据。 Objective C代码如下: // Instance method to get the heart rate BPM information – (void) getHeartBPMData:(CBCharacteristic *)characteristic error:(NSError *)error { // Get the Heart Rate Monitor BPM NSData *data = [characteristic value]; // 1 const uint8_t *reportData = [data bytes]; uint16_t bpm = 0; if ((reportData[0] & 0x01) == 0) { // […]

在iPhone中创build一个秒表

我正在尝试创build一个简单的秒表。 我提到这个网站( http://www.apptite.be/tutorial_ios_stopwatch.php )做这个应用程序。 当我点击开始button,我得到-596:-31:-23:-648秒表不运行。 代码如下所示: ViewController.h #import <UIKit/UIKit.h> @interface ViewController : UIViewController{ UILabel *lbl; NSTimer *stopTimer; NSDate *startDate; } @property (strong,nonatomic) IBOutlet UILabel *lbl; -(IBAction)startPressed:(id)sender; -(IBAction)stopPressed:(id)sender; -(void)updateTimer; @end ViewController.m #import "ViewController.h" @interface ViewController () @end @implementation ViewController @synthesize lbl; – (void)viewDidLoad { [super viewDidLoad]; lbl.text = @"00.00.00.000"; } – (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // […]

在iOS PhoneGap 3.3上链接到本地​​文件(cdvfile://)

要轻松更新我的应用程序,我将www文件夹的内容复制到手机,然后执行window.location = workingDirectory.toURL() + "/index.html" 。 编辑 – 请注意,这个工作,直到Phonegap 3.4,但不是3.5(当我试图改变位置似乎没有发生)。 如果不使用toNativeURL ,而使用toNativeURL ,那么它也可以使用3.5。 使用toNativeURL也修复了iOS上的当前问题 。 复制所有文件并打开索引在iOS和Android上都可以正常工作。 iOS上的问题虽然是绝对没有风格的页面,就好像到CSS文件的链接不工作。 在Android上一切正常。 我的链接是相对的(例如<link href="css/reseter.css" rel="stylesheet"> )。 链接到其他页面或脚本的工作。 这里是我打开的简体主页: <!DOCTYPE html> <html> <head> <title></title> <link href="style.css" rel="stylesheet"> <script src="main.js"></script> </head> <body> <div class="red">I should be red but I'm not!</div> <a href="page2.html">This correctly takes me to the other page.</a> </body> </html> […]

如何隐藏/显示UITabBarController的标签栏与animation?

我有一个关于iOS的UITabBarController的标签栏的问题。 我正在使用UITabBarController来显示一些视图,但我希望视图尽可能大的屏幕显示。 是否有可能隐藏标签栏,以便它通常不显示,直到用户触摸屏幕,然后标签栏将(与animation)显示在底部。 然后,几秒钟后,如果没有任何事情做,那么标签栏将再次消失,以便视图又回到全屏幕?

打印纸张尺寸和内容插图

我正在使用以下代码来打印包含文本和图像的HTML内容。 if (![UIPrintInteractionController isPrintingAvailable]) { UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Printer Availability Error Title", @"") message:NSLocalizedString(@"Printer Availability Error Message", @"") delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"OK") otherButtonTitles:nil] autorelease]; [alertView show]; return; } UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController]; if(!pic) { NSLog(@"Couldn't get shared UIPrintInteractionController!"); return; } pic.delegate = self; UIPrintInfo *printInfo = [UIPrintInfo printInfo]; printInfo.outputType = UIPrintInfoOutputGeneral; printInfo.jobName = […]

使用iOS 5 AV Foundation和core-image实时确定一张纸的边angular

我目前正在build立一个相机应用程序原型,应该能够识别桌子上的纸张。 关于这个的线索是它应该实时地进行识别,所以我捕捉了相机的videostream,这在iOS 5中可以很容易地用AV基础来完成。 我看着这里和这里 他们正在那里做一些基本的对象识别。 我发现在这个实时环境中使用OpenCV库不能以高性能的方式工作。 所以我需要的是一个algorithm来确定没有OpenCV的图像的边缘。 有没有人有一些示例代码片段展示了如何做到这一点,或指出我在正确的方向。 任何帮助,将不胜感激。

iOS应用程序中没有CATiledLayer的巨大图像?

我有一个约7000×6000像素的图像。 我需要这个在我的应用程序中的scrollview / imageView,但是这是巨大的方式来显示。 它应该是一种地图。 我希望能够将应用程序的大小保持在最低限度,图像大小约为13mb。 在PNG是超过100MB,这是不能接受的。 许多人build议CATiledLayer作为一个选项,但我相信这将导致更大的文件大小。 无论如何,我试图用CATiledLayer ,并在TileCutter中创build我自己的瓷砖,(瓷砖以.jpg为单位),尺寸不是太差。 但是我到处都有错误。 CATiledLayer的iOS版本对我来说是一个谜,我找不到解决这个问题的方法。 我得到一个错误,说有关java的等价“索引超出数组的界限”,即使该数组有内容在该特定的索引..它有一个方法返回一个数组。 该数组包含.plist的数据。 在返回之前,我注销了数组的内容,给了我很好的数据。 电话正试图访问 [array objectAtIndex:0] 并把它放在一个字典,但抛出OutOfBounds。 注销整个数组时,我可以清楚地看到内容,但是在注销时 NSLog("%@",[method objectAtIndex]); I get the same exception. 无论如何, CATiledLayer给了我一些问题。 我一直在逆向工程的PhotoScroller项目没有运气。 任何人都有其他的解决scheme 谢谢。