草庐IT

coordinate_row

全部标签

ios - 转换矩形 :toView doesn't return expected window coordinates

目前,我正在尝试获取UIWebView的坐标。这个webView是viewControllerView的subview。viewController包含在UINavigationController中。状态栏和导航栏都在屏幕上。方向为纵向。View已模态呈现。状态栏的高度为20,导航栏的高度为44,我希望webView的框架(在窗口坐标中)的原点为(0,64),宽度为(320,416).但是,当我运行这条线时CGRectframe=[webView.superviewconvertRect:webView.frametoView:nil];我得到(0,0)的原点和(320,416)的宽

iphone - coreplot :Converted coordinates, 有问题。 [plotSpace plotPoint:plotPoint forPlotAreaViewPoint:point];

我想将接触到的点转换为CPTXYPlotSpace点。但我发现那里有真实坐标的偏移量。我发现,它从边界计算了x轴的一部分。我想将点映射到x&y轴的值。我的英语很差....我想知道哪里错了?请告诉我。这是代码。-(BOOL)plotSpace:(CPTPlotSpace*)spaceshouldHandlePointingDeviceDownEvent:(id)eventatPoint:(CGPoint)point{NSDecimalplotPoint[2];CPTXYPlotSpace*plotSpace=(CPTXYPlotSpace*)graph.defaultPlotSpace;

ios - 如何通过 segue 传递 Section 和 Row 指定的 tableview 单元格内容?

我经常使用prepareForSegue将内容传递给下一个ViewController。当我的tableview不使用部分时没问题。但是我已经在我的最新项目中添加了部分。现在我不知道如何使用prepareForSegue因为它没有收到包含部分引用的索引路径。我错过了什么?感谢您的帮助! 最佳答案 在您的prepareForSegue方法中,只需使用:NSIndexPath*indexPath=[self.tableViewindexPathForSelectedRow];并将其传递给destinationViewController

ios - SQLite step() 即使表为空也返回 SQLITE_ROW

我正在尝试从SQLite中的表中获取行:_tempPath=[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES)objectAtIndex:0]stringByAppendingPathComponent:@"test.db"];sqlite3*pHandle;sqlite3_stmt*pStatementHandle;NSLog(@"OPEN:%i",sqlite3_open([_tempPathUTF8String],&pHandle));constchar*query="se

ios - 重新加载部分 :withRowAnimation: doesn't update number of rows

我在小部件中有一个UITableView,我希望用动画重新加载它。[self.tableViewreloadData]效果很好,但重新加载不是动画。我知道我应该使用reloadSections:withRowAnimation:来制作动画,但是有一个问题。表格确实在更新,numberOfRowsInSection:返回新值,但视觉上看到的行数仍然相同。例如:如果我有一个有2行的UITableView,我想将它更新为4行,那么表格中仍然会有2行。这2个单元格中的内容将按预期更新,但应该有4个单元格。我知道numberOfRowsInSection:返回4。当调用[self.tableVi

ios - Q :Get rows count by indexPath of tableView comes `Trying to put the stack in unreadable memory at:` error

在我的tableView委托(delegate)方法中:我在tableViewdelegate方法中得到了numberOfRows和numberOfSections:-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath和-(CGFloat)tableView:(UITableView*)tableViewheightForRowAtIndexPath:(NSIndexPath*)indexPath,但是在-(NSInteger)tableView

ios - 无效更新 : invalid number of rows in section 0

当我尝试在列表中删除或添加对象时遇到问题错误:2014-09-0410:59:03.815DeleteListTest[2781:60b]***Assertionfailurein-[UITableView_endCellAnimationsWithContext:],/SourceCache/UIKit_Sim/UIKit-2935.137/UITableView.m:13682014-09-0410:59:03.856DeleteListTest[2781:60b]***Terminatingappduetouncaughtexception'NSInternalInconsist

ios - Tableview 按钮获取 index.row

我在tableview单元格中有一个按钮(名为“deleteTemplate”),当它被按下时我应该得到按钮所在单元格的“index.row”。任何人都知道如何获得“index.row”对于单元格,当您单击单元格中的按钮时?我当前的按钮代码:UITableViewCell*clickedCell=(UITableViewCell*)[[sendersuperview]superview];NSIndexPath*clickedButtonIndexPath=[self.tableViewindexPathForCell:clickedCell];NSDictionary*dic=[ta

iphone - UIButton 标记未在 6 个单元格后分配 indexPath.row

我这里遇到了一个奇怪的问题。我有一个TableView,我将indexPath.row分配给UIButton的标签,这样我就可以将该标签作为参数传递给segue,并将对象提供给下一个ViewController。一切正常,直到我经过TableView中的6个单元格,当按下按钮时从数组中传递了错误的对象。我决定放入一些NSLog来查看发生了什么,我发现结果很奇怪。分配buttonForApplyingTag.tag=indexPath.row;发生在NSLogs之后,是returncell;之前的最后一个语句。由于indexPath.row的实际值是正确的,因此可以正确加载数组中的对象。

ios - 如何在 Xcode lldb 控制台窗口中显示 UITableView indexPath.row

如何在控制台窗口中打印出UITablesindexPath.row。我不想到处添加NSLogs。我一直收到“不是成员(member)”或属性(property)。(lldb)expr(int)printf("%d\n",self.lastChangedIndexPath->_row)error:'NSIndexPath'doesnothaveamembernamed'_row'(lldb)printself.lastChangedIndexPath->_rowerror:'NSIndexPath'doesnothaveamembernamed'_row'(lldb)printself.