我有UITableViewCell一个UITableViewController.在我的手机有一个按钮,当你点击带你到另一个view用prepareforsegue.在prepareForSegue我这样做:
if ([[segue identifier] isEqualToString:@"MySegue"])
{
UITableViewCell *cell = (UITableViewCell*) [[sender superview] superview];
UITableView *table = (UITableView*)[[[sender superview] superview] superview];
NSIndexPath *indexPath = [table indexPathForCell:cell];
}
Run Code Online (Sandbox Code Playgroud)
好!一切都运作良好.但是现在我已经用iOS7升级了xCode,当我点击单元格中的按钮时,一个错误出现给我,我不知道如何解决它:
[UITableViewCell indexPathForCell:]: unrecognized selector sent to instance 0x9e160b0
2013-09-20 16:30:44.427 MyApp[8212:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableViewCell indexPathForCell:]: unrecognized selector sent to instance 0x9e160b0'
*** First throw call stack:
(
0 CoreFoundation 0x024475e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x01a5d8b6 …Run Code Online (Sandbox Code Playgroud) 将UISearchBar添加到我的MK-MapView,并使用UISearchBar中编写的搜索字符串在地图上获取地址.后来我必须能够转换NSString中地图上指示的地址!你能帮我吗?我在谷歌搜索但我什么都不懂!请帮助我..我使用了这个项目,但是当我运行搜索时,地图仍然是相同的点:我使用的项目
在方法viewDidLoad中我初始化了一个ActivityIndicatorView.然后,在下面的方法中,我发送了活动指示符来启动.当我启动应用程序并运行if语句时,活动指示器会启动,但是当执行调度队列中的操作时,activityIndicator不会停止.这里的方法:
-(void) tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if([indexPath row] == [_myArray count]-2){
[_activityIndicator startAnimating];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
//Here I perform some operations
[self.tableView reloadData];
[_activityIndicator stopAnimating];
});
}
}
Run Code Online (Sandbox Code Playgroud)
我希望在调度队列中执行操作后停止活动指示器!
ios ×3
objective-c ×2
uitableview ×2
ios7 ×1
mapkit ×1
mkmapview ×1
segue ×1
superview ×1
uisearchbar ×1