我有多个部分的tableview.每个部分有不同的行.当我在特定部分中选择特定行时,如何找到正确的indexPath.row?任何教程?
你如何计算iPhone SDK中的cos,sin,tan三角函数?
我尝试了tan(45),但它返回了错误的输出?任何帮助?
我在我的视图控制器视图中有代码像这样加载..但UIBarButtonItem不在工具栏的右侧.它在左侧.任何帮助?如何给工具栏的标题?
UIToolbar *toolbar = [UIToolbar new];
toolbar.barStyle = UIBarStyleBlackTranslucent;
// create a bordered style button with custom title
UIBarButtonItem *playItem = [[[UIBarButtonItem alloc] initWithTitle:@"Play"
style:UIBarButtonItemStyleBordered
target:self
action:@selector(flipToSchedules:)] autorelease];
self.navigationItem.rightBarButtonItem = playItem;
NSArray *items = [NSArray arrayWithObjects: playItem, nil];
toolbar.items = items;
// size up the toolbar and set its frame
// please not that it will work only for views without Navigation toolbars.
[toolbar sizeToFit];
CGFloat toolbarHeight = [toolbar frame].size.height;
CGRect mainViewBounds = self.view.bounds;
[toolbar setFrame:CGRectMake(0, 20,
CGRectGetWidth(mainViewBounds), toolbarHeight)];
[self.view …Run Code Online (Sandbox Code Playgroud) 当我滚动时,我的tableview显示这样......你会帮助我做错了吗?请问有什么帮助吗?如果你看到那张图片,我选择的价值超过了写作........
http://www.freeimagehosting.net/image.php?fa76ce6c3b.jpg
代码是
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.textLabel.font = [UIFont boldSystemFontOfSize:14.0];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
CGRect rectLbl2 = CGRectMake(75 ,1, 215, 32);
CGRect rectLbl3 = CGRectMake(75 ,28, 215, 30);
addLabel2= [[UILabel alloc] initWithFrame:rectLbl2];
addLabel3= [[UILabel alloc] initWithFrame:rectLbl3];
addLabel2.text = @"senthil";
[cell addSubview:addLabel2];
[addLabel2 release]; // for memory release
addLabel3.text= @"senthil";
[cell addSubview:addLabel3];
[addLabel3 release];
return cell;
Run Code Online (Sandbox Code Playgroud)
}
我从NSDateComponents获得第二名.但它返回长数,我怎么能得到正确的第二个......?例如55秒...(就像123232133那样)
NSCalendar *sCalendar = [NSCalendar currentCalendar];
unsigned int unitFlags = NSHourCalendarUnit | NSMinuteCalendarUnit |
NSDayCalendarUnit | NSMonthCalendarUnit;
NSDateComponents *Info = [sCalendar components:unitFlags
fromDate:date1 toDate:date2 options:0];
NSLog(@" %dsec ",[Info second]);
Run Code Online (Sandbox Code Playgroud)
它打印像2323324324 ....
任何人都可以分辨出willRotateToInterfaceOrientation,willAnimateRotationToInterfaceOrientation,didRotateFromInterfaceOrientation之间的差异,
我想初始化NSString是双haoutes的"hai"..它可能吗?有什么帮助吗?但是NSString*str = @"hai"; 我想在没有直接初始化的情况下将其转换为"hai"?有什么帮助吗?
char**r; r =(char**)malloc(10);
上面的分配是否足够?我不需要为char循环分配for循环吗?任何可以解释哪一个是正确的?
我正在使用UIPinchGestureRecognizer.can我写了两个用于捏合和捏合的动作..是否有任何特定的方法(委托)?我只写了一个当我捏入时被调用...
UIPinchGestureRecognizer *pinchGesture = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchGesture:)];
[self.view addGestureRecognizer:pinchGesture];
[pinchGesture release];
Run Code Online (Sandbox Code Playgroud)