小编Rah*_*ane的帖子

如何计算NSDictionary对象的总大小?

如何计算NSDictionary物体的总大小?我有3000个NSDictionary不同键的StudentClass对象.我想以KB为单位计算字典的总大小.我用过malloc_size()但总是返回24(NSDictionary包含1个对象或3000个对象) sizeof()也总是返回相同.

malloc sizeof ios ios5 ios6

7
推荐指数
2
解决办法
6603
查看次数

UILabel动画上下

我有这个UILabel动画,动画倒计时器.它工作正常,但......

现在,它的设置使文本从顶部缓和使用CATransition kCATransitionFromBottom.这需要0.5秒.如何才能使它在接下来的0.5秒内,CATransition我的标签缓和到底部?

希望你能理解!谢谢!

这是一个关于动画现在如何看的视频:http://tinypic.com/r/5vst2h/8

-(void)updateLabel {

NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
int *units = NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;
NSDateComponents *components = [calendar components:units fromDate:[NSDate date] toDate:destinationDate options:0];


    //ANIMASJON

secLabel.alpha = 0;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];

//don't forget to add delegate.....
[UIView setAnimationDelegate:self];

[UIView setAnimationDuration:0.5];
secLabel.alpha = 1;

//also call this before commit animations......
[UIView setAnimationDidStopSelector:@selector(animationDidStop:finished:context:)];

CATransition *animation = [CATransition animation];
animation.duration = 0.5;   //You can …
Run Code Online (Sandbox Code Playgroud)

animation objective-c uilabel ios

3
推荐指数
1
解决办法
9283
查看次数

GoogleAnalytics 3.10 - 如何从日志中删除IDFA警告?

我正在开发一个应用程序,其中我添加了GoogleAnalytics 3.10库.

但每当我尝试运行应用程序时,我会在日志中看到警告 -

VERBOSE: GoogleAnalytics 3.10 +[GAITrackerModel initialize] (GAITrackerModel.m:88): idfa class missing, won't collect idfa
Run Code Online (Sandbox Code Playgroud)

根据Apple的指南,如果您使用IDFA而非广告目的,您的应用可能会被拒绝.

我已经找到了这个解决方案,但它对我不起作用.因为3.03c没有GAIEcommerceFields.h和它的相关类.

我没有链接iAd.framework,AdSupport.framework或者libAdIdAccess.a在我的项目中.

我的问题是如何摆脱这种警告?如果无法删除此警告,苹果会批准我的应用吗?

google-analytics ios iad google-analytics-sdk

3
推荐指数
1
解决办法
1560
查看次数

触摸UIView子类上的事件作为UIScrollView的子视图

我已经实现了自己的自定义子类UIView并覆盖了该drawRect:方法.

在我的自定义视图中,我也想要手柄触摸,所以我也覆盖了touchesBegan,touchesMoved并且touchesEnded.

这工作正常,但如果屏幕上的视图数量增加,那么我必须使用a UIScrollView作为我的根视图UIViewController.

一旦我的自定义UIView成为子视图UIScrollView,它就不会收到触摸事件.即使我在我的自定义内移动手指UIView,滚动视图也会滚动(我的所有触摸事件都会转到UIScrollView).

我该如何解决这个问题?

touch uiscrollview uiview

1
推荐指数
1
解决办法
4768
查看次数