是否有苹果屋制作的方式来获得带有ProgressView的UISlider.这被许多流应用程序使用,例如本机quicktimeplayer或youtube.(只是为了确定:我只对可视化感兴趣)

西蒙欢呼
我在一些外国代码中读过一些东西,我想检查一下我的假设:
@synchronized(self)用于self在设置属性时删除前缀.
所以在我下面的例子中,我正在设置strText实例,而不仅仅是局部变量,对吧?
- (void)myfunction{
NSString * strText = @"var in function";
@synchronized(self)
{
strText = @"var class (self.strText)";
}
}
Run Code Online (Sandbox Code Playgroud) 我想要两个NSInteger一年,一个月回去一个月.例如现在是2011-01我怎么能得到2010-12.添加是一回事,但我想减去.
NSDate *date = [NSDate date];
NSDateComponents *dateComponents = [calendar components:unitFlags fromDate:date];
NSInteger year = [dateComponents year];
NSInteger month = [dateComponents month];
[calendar release];
NSString * pdf_name = [NSString stringWithFormat:@"file_%d_%02d.pdf", year, month];
Run Code Online (Sandbox Code Playgroud)
迎接endo
编辑:我的解决方案
NSCalendar *calendar= [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSCalendarUnit unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit;
NSDate *date = [NSDate date];
NSDateComponents *dateComponents = [calendar components:unitFlags fromDate:date];
NSInteger year = [dateComponents year];
NSInteger month = [dateComponents month];
BOOL substractOneMonth …Run Code Online (Sandbox Code Playgroud) 我正在使用UISlider,它会自动更新,除非用户触摸滑块按钮.因此我在NSTimer自动更新的功能中执行此操作:
if (!isSliderTouched) {
[progressSlider setValue: progressValue];
}
Run Code Online (Sandbox Code Playgroud)
当用户松开手指时,如何跟踪此事件的结束.只要用户与此控件交互,我想设置isSliderTouched.
编辑:这应该是情节:
方案:
UIControlEventTouchDown
UIControlEventTouchUpInside
[progressSlider addTarget:self action:@selector(sliderMoveStart) forControlEvents:UIControlEventTouchDown];
Run Code Online (Sandbox Code Playgroud)
欢呼声
序言:前几天我问了一个问题来解决一个HABTM过滤器,我甚至不能用教程来做,所以"Obi Kwan Kenobi你是我唯一的希望".
我想要实现的目标:按StaffStaffgroup中使用的GroupID过滤员工
我有以下tablelayout
变量$ tmp给我一个工作数组,但问题是Staff是StaffStaffgroups的子对象.我可以解析throu并重新组装一个数组,但这不是一个很好的解决方案.所以我想在Staff上使用条件(参见注释行),但后来我得到错误1054"未找到列:1054未知列".我试图绑定和取消绑定,但没有结果.
$group_id = 2;
$tmp = $this->Staff->StaffStaffgroup->find('all',
array('conditions' => array(
'StaffStaffgroup.staffgroup_id' => $group_id,
'Staff.isActive =' => "1",
'Staff.last_name LIKE' => "%$name%",
)
)
);
debug($tmp);
Run Code Online (Sandbox Code Playgroud)
//$tmpConditions['AND'][] = array('StaffStaffgroup.staffgroup_id' => $group_ids);
Run Code Online (Sandbox Code Playgroud)
编辑:
我尝试了条件和可容纳的行为,但不幸的是它根本没有过滤任何东西
$this->Staff->contain(array('StaffStaffgroup'));
$this->paginate = array('StaffStaffgroup' =>array(
array('conditions' => array(
'StaffStaffgroup.staffgroup_id' => '2'
)
)
)
);
Run Code Online (Sandbox Code Playgroud)
我也尝试了内连接,但没有过滤:
$this->paginate = array(
'conditions' => array('StaffStaffgroup.staffgroup_id' => 2 ),
'joins' => array( …Run Code Online (Sandbox Code Playgroud)Flurry有一个很好的选择吗?我使用它是因为它易于集成,但我对Web界面并不满意.我想念google-analitic-ness,但我不想使用谷歌.
那么,您对iPhone的其他分析有哪些经验?
迎接西蒙
编辑:
我有一个在SnowLepard Preview中看起来非常完美的PDF,但是当我在WebView中加载相同的PDF时,pdf将无法显示正确的颜色.我的第一个想法是RGB/CMYK问题,但我被卡住了.
什么pdf格式最适合iOS?
欢呼声
- (void)viewDidAppear:(BOOL)animated {
<CODE BEFORE>
[super viewDidAppear:animated];
<CODE AFTER>
}
Run Code Online (Sandbox Code Playgroud)
什么是正确的,在超级电话之前或之后放置所有代码?它的工作方式是双向的,但我不知道是否更好等待电话直到结束或者在开始时提交它?
欢呼声
我的目标是以编程方式更改UIBarButton的图像(我用作IBOutlet).
我在stackoverflow上找到了这个解决方案,改变了uibutton-with-other-image的图像.但这不适用于iOS 4.2.
任何人都可以帮助我.西蒙
我试过了:
UIImage *image = [UIImage imageWithContentsOfFile:
[[NSBundle mainBundle] pathForResource:@"play" ofType:@"png"]];
playButton.image = image;
Run Code Online (Sandbox Code Playgroud)
UIImage *image = [UIImage imageWithContentsOfFile:
[[NSBundle mainBundle] pathForResource:@"play" ofType:@"png"]];UIImage *image = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"play" ofType:@"png"]];
CGRect frame = CGRectMake(0, 0, image.size.width, image.size.height);
UIButton* someButton = [[UIButton alloc] initWithFrame:frame];
[someButton setBackgroundImage:image forState:UIControlStateNormal];
[someButton setShowsTouchWhenHighlighted:YES];
playButton = [[UIBarButtonItem alloc]initWithCustomView:someButton];
[someButton release];
Run Code Online (Sandbox Code Playgroud) 我达不到我的目标.我的目标是在列中找到下一个更高的值.所以我得到了一列不合适的数字.这是一个例子
7897
1000
1341
1245
8967
4234
Run Code Online (Sandbox Code Playgroud)
在它旁边的列中,我想要获得更高的值
7897 => 8967
1000 => 1245
1341 => 4234
Run Code Online (Sandbox Code Playgroud)