Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 30, 2009, 07:14 PM   #1
Danneman101
macrumors 6502
 
Join Date: Aug 2008
Manually call tableview's didSelectRowAtIndexPath?

Is it possible to manually call the tableview's didSelectRowAtIndexPath with, say, the row-nr 1?

Code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ 
     // stuff
}
If so, how would you construct that call? Im a bit confused as to how to make a functioncall with parameters in obj-c. My guess would be:

Code:
[MyTableView didSelectRowAtIndexPath:1];
..since my viewcontroller both declares and sets to property "MyTableView" in .h, and synthezises it in .m.

But even though it compiles (with a warning that "UITableView may not respond to -"didSelectRowAtIndexPath"), it crashes pretty quickly.
Danneman101 is offline   0 Reply With Quote
Old May 30, 2009, 08:15 PM   #2
firewood
macrumors 603
 
Join Date: Jul 2003
Location: Silicon Valley
Did you put a prototype in your interface declaration?

Did you intend to to pass an integer into a indexPath object pointer parameter?
firewood is offline   0 Reply With Quote
Old May 31, 2009, 04:50 AM   #3
Danneman101
Thread Starter
macrumors 6502
 
Join Date: Aug 2008
Quote:
Originally Posted by firewood View Post
Did you put a prototype in your interface declaration?
No, I just declared the tableView as such:
Code:
@interface Level1ViewController : UIViewController <UINavigationBarDelegate, UITableViewDelegate, UITableViewDataSource>
{
	IBOutlet UITableView			*myTableView;
}
The actual function-definition (didSel..) is in the .m-file. Do I need to put its prototype in the .h-file as well?


Quote:
Originally Posted by firewood View Post
Did you intend to to pass an integer into a indexPath object pointer parameter?
Well, what I want to do is that under a certain condition managed by a settings-variable (for instance, if "setting_row == 1"), I want a table-row to be automatically selected as if row 1 in the tablerow had been pressed which would have called didSelectRowAtIndexPath. So that would mean manually passing the row-nr as a parameter, but perhaps it should not be in the form of an integer?
Danneman101 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
iPhone: Cannot pick up calls on wait, Cannot make a second call holding the first call MPriya iOS 7 3 Jul 31, 2014 04:27 PM
I got a phone call from Apple about a bug report, has anyone else received a call? adcx64 iOS 7 6 Jul 23, 2013 03:07 PM
Xcode didSelectRowAtIndexPath on tableview not called KimGysen iPhone/iPad Programming 12 Oct 2, 2012 01:19 PM

Forum Jump

All times are GMT -5. The time now is 09:40 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps