我有一个graphview.m以这种方式创建coreplotviewcontroller.view
CorePlotViewController *aCorePlotViewController = [[CorePlotViewController alloc] initWithNibName:@"CorePlotViewController" bundle:nil];
aCorePlotViewController.view.bounds = CGRectMake(0,0,896,605);
aCorePlotViewController.view.center = CGPointMake(576, 374.5);
[aCorePlotViewController.view setTag:99];
[self.view addSubview:aCorePlotViewController.view];
[aCorePlotViewController.view release];
Run Code Online (Sandbox Code Playgroud)
现在我通过删除并再次添加图表来刷新图表.
[[self.view viewWithTag:99]removeFromSuperview];
CorePlotViewController *aCPView = [[CorePlotViewController alloc] initWithNibName:@"CorePlotViewController" bundle:nil];
aCPView.view.bounds = CGRectMake(0,0,896,605);
aCPView.view.center = CGPointMake(576, 374.5);
[aCPView.view setTag:99];
[self.view addSubview:aCPView.view];
[aCPView release];
Run Code Online (Sandbox Code Playgroud)
但这会占用大量内存,最终我无法再为CoreAnimation分配内存(即时记录此错误).
那么我该如何重新创建图表呢?假设在coreplotviewcontroller.m中使用创建方法来重绘图形.我目前的CorePlotViewController.h和.m代码如下
CorePlotViewController.h
#import <UIKit/UIKit.h>
#import "CorePlot-CocoaTouch.h"
#import "GraphView.h"
@interface CorePlotViewController : UIViewController <CPPlotDataSource>
{
CPXYGraph *graph;
NSMutableArray *dataForPlot;
NSMutableArray *dataForPlot2;
NSMutableArray *finalDatas;
NSMutableArray *numofdata;
NSMutableArray *numofdata2;
}
@property(readwrite, retain, nonatomic) NSMutableArray *dataForPlot;
@property(readwrite, retain, nonatomic) …Run Code Online (Sandbox Code Playgroud) 如果objectatIndex有任何值,我如何检查数组?即时通讯使用forloop
for (i = 0; i < 6 ; i++)
{
if ([array objectAtIndex: i] == NULL)//This doesnt work.
{
NSLog(@"array objectAtIndex has no data");
}
}
Run Code Online (Sandbox Code Playgroud) 我在运行PushMeBaby示例时遇到错误,如本教程中推送的推送通知http://mobiforge.com/developing/story/programming-apple-push-notification-services
在控制台中,错误消息是
connect returned error
Run Code Online (Sandbox Code Playgroud)
PushMeBaby[708:a0f] MakeServerConnection(): -36
PushMeBaby[708:a0f] SSLNewContext(): 0
PushMeBaby[708:a0f] SSLSetIOFuncs(): 0
PushMeBaby[708:a0f] SSLSetConnection(): 0
PushMeBaby[708:a0f] SSLSetPeerDomainName(): 0
PushMeBaby[708:a0f] SecKeychainOpen(): 0
PushMeBaby[708:a0f] SecCertificateCreateFromData(): 0
PushMeBaby[708:a0f] SecIdentityCreateWithCertificate(): 0
PushMeBaby[708:a0f] SSLSetCertificate(): 0
\274\270LN\247\373?\276a\216\222\376\216\367\262p\332\302 \2342\3713\301_ZV\344'sV\300
\300 \300\300\300\300\300\300\300\300\300\300\300\300\300
\300
/5
23894:9#!gateway.sandbox.push.apple.comRun Code Online (Sandbox Code Playgroud)
每次我构建并运行它时,数字串似乎都会改变.
我检查了设备令牌,我有aps_developer_identity.cer
有没有人成功地使这个东西工作?
所以基本上在我的app委托中我有一个navigation.controller
此导航控制器具有名为MainScreen的类的视图.
在MainScreen.m中,我有一个IBAction,通过推送它将我带到SelectionScreen.m页面.这是它的编码
SelectionScreen *aSelectionScreenViewController = [[SelectionScreen alloc]initWithNibName:@"SelectionScreen" bundle:nil];
[self.navigationController pushViewController:aSelectionScreenViewController animated:YES];
[aSelectionScreenViewController release];
Run Code Online (Sandbox Code Playgroud)
那么我该如何检查我当前的navigationController.view =这个selectionscreen.view?
检查当前视图的原因是因为当我收到推送通知时,我想自动切换到此SelectionScreen.m页面并调用其中的一些方法.但是这个检查只能在appDelegate中完成,因为didReceiveRemoteNotification方法位于那里.
我有一个[self parseXMLFileAtURL:path]方法.无论如何中途停止它?喜欢终止方法.
这样做的原因是我在一台PC上运行apache http服务器,如果服务器没有运行,如果调用此方法,应用程序将"挂起".所以我想要在一定时间后终止方法,5s也许.并显示警告信息.
我需要了解如何充分利用推送通知系统.我阅读了苹果网站上的推送通知指南,但仍然不清楚某些事情.
可以说我有一台Windows PC和一台iPad.1)PC应配置成什么才能成为"提供者"?是否应将其配置为服务器,根据请求提供数据.2)提供商如何将令牌发送给APN?
使用推送通知系统的原因是我可以调用(tablereload数据)方法,以便它更新表,因为它有一些自定义图像作为其子视图添加,所以如果服务器端的某些条件是满足.
感谢阅读的人,希望得到任何反馈或帮助.
干杯,Ephist
我刚接触php.我有一个基本的unlink php文件删除test.html.使用Apache httpserver
<?php
$fh = fopen('test.html', 'a');
fwrite($fh, '<h1>Hello world!</h1>');
fclose($fh);
unlink('test.html');
?>
Run Code Online (Sandbox Code Playgroud)
那么现在我如何设置一个身份验证方法,以便只有具有正确用户名/密码的人才能访问此文件?