我正在为客户开发一款iPad应用程序.有大量的工作已经完成,我正在努力拼凑整个设计的运行方式.
我想做的其中一件事是记录应用程序运行时调用哪些方法.我见过一个自定义DTrace脚本,它意味着记录启动时的所有方法,但是当我在Instruments中运行它时,我没有得到任何结果.
记录方法的最佳方法是什么?
为了响应Apple对iOS数据存储指南的更改,我最近重新配置了一个iPad应用程序,用于将其文档(50MB +)存储在library/caches文件夹中.
在iOS模拟器中进行测试期间,我在模拟更新时没有看到此缓存有任何问题(遵循Brad Larsson的建议).我还尝试删除library/caches文件夹的所有内容,以确保我的应用程序可以恢复.
但是,当我发布应用程序升级时,我发现我的用户抱怨可以追溯到iPad部分删除此缓存的问题.看起来子文件夹结构至少部分保持完整,但子文件夹内容被删除.
我已经重新设计了应用程序以在升级期间处理这种情况,但我担心当iPad决定清除库/缓存时会发生什么.
有没有人对iPad尝试删除此缓存中的项目的时间有任何经验或洞察力?
谢谢
我有UICollectionView一个习惯UICollectionViewCell.该UICollectionView水平滚动,每个单元占据所有可见的画面.
该UICollectionViewCell有一个UIView子视图,这反过来又一个UIScrollView子视图.
在UIScrollView旨在垂直滚动,但它不是在所有的滚动.我试过设置滚动视图contentSize没有成功.
我怀疑UIScrollView是没有得到任何触摸事件而不是它是一个大小问题.
有什么建议?
编辑>>
我现在确定这是一个事件问题,而不是特定的事情UIScrollView.
我现在已经覆盖了pointInside:in UIView中的方法,UICollectionViewCell并且可以看到它现在每次点击它都会返回false.在这种情况下,您会认为tap事件会传播到下一个子视图,但UIView仍然没有获取事件.我已经尝试添加一个UIGestureRecognizer,UIView但它永远不会注册一个水龙头.
这里有什么东西拦截我不知道的事件吗?
我有一个带有20个标记的Google Map(v3).我有一个InfoBox实例,其中填充了一个div,其中包含填充框作为innerHTML的文本.
我希望能够点击信息框并导航到另一个页面,但我无法获取信息框或其中的div来响应点击事件.
我已经尝试添加一个事件监听器,我尝试添加一个domListener,但我无法工作.
以下是我的代码中的一些代码段
//setting up the infobox
var infobox = new InfoBox({
disableAutoPan: true
,isHidden:false
,pixelOffset: new google.maps.Size(-10, -10)
,closeBoxURL: ""
,pane: "mapPane"
,enableEventPropagation: true
});
//setting up the div
var boxText1 = document.createElement("div");
boxText1.id = "boxText1";
boxText1.className = "labelText";
boxText1.innerHTML = title1;//this is created earlier
//the marker event listener - the marker and coordinates are also set up earlier
google.maps.event.addListener(_marker1, 'click', function() {
infobox.content_ = boxText1;
infobox.position_ = mkLatLng1;
infobox.open(map);
});
//so far everything ok. When the …Run Code Online (Sandbox Code Playgroud) 我有一个带有几个html5标签的网页,为用户提供了许多可以选择播放的视频的海报/缩略图.当用户触摸其中一个时,iPhone视频播放器将打开并播放视频.我希望能够在视频播放完毕后自动关闭视频播放器并将用户返回到缩略图.
我为"已结束"事件设置了事件监听器,我可以检测到视频已经完成,但我无法弄清楚如何关闭视频播放器并返回缩略图.它只是等待用户触摸"完成"按钮.在Javascript中有没有办法做到这一点?
我正在尝试在NSOperationQueue设置的线程上运行NSTimer
-(void)apiCallbackQueueManager:(NSString *)callid :(NSString *)service:(NSString *)action:(NSString *)data{
SEL theSelector = @selector(apiCallbackQueueTimer: service: action: data:);
NSMethodSignature * sig = [self methodSignatureForSelector:theSelector];
NSInvocation * theInvocation = [NSInvocation invocationWithMethodSignature:sig];
[theInvocation setTarget: self];
[theInvocation setSelector: theSelector];
[theInvocation setArgument: &callid atIndex: 2];
[theInvocation setArgument: &service atIndex: 3];
[theInvocation setArgument: &action atIndex: 4];
[theInvocation setArgument: &data atIndex: 5];
NSInvocationOperation* operation = [[NSInvocationOperation alloc] initWithInvocation:theInvocation];
NSOperationQueue *apiQueue = [[NSOperationQueue alloc] init];
[apiQueue addOperation:operation];
}
-(void)apiCallbackQueueTimer:(NSString *)arg1 service:(NSString *)arg2 action:(NSString *)arg3 data:(NSString *)arg4{
apiTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self …Run Code Online (Sandbox Code Playgroud) 我正在使用MKMapKit在地图上显示一些搜索结果.我正在使用
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
Run Code Online (Sandbox Code Playgroud)
检查何时按下标注,但我能够获得的唯一信息是view.annotation.title.这对我没有用,因为我可能会有很多相同标题的结果.
我已经在类中添加了一个business_id属性,但我似乎无法在此方法中读取它.我猜这个方法只适用于属于View的元素?
唯一确定哪个标注被触及的最佳方法是什么?
谢谢.
ios ×4
iphone ×3
ipad ×2
google-maps ×1
html5 ×1
instruments ×1
mkmapview ×1
nstimer ×1
objective-c ×1
uiscrollview ×1
video ×1