Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
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 online now   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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
iPhone 4 Call Failed ssdeg7 iPhone Tips, Help and Troubleshooting 25 Jul 23, 2013 11:13 PM
iPhone4: Does your screen blink lightly during a call? Thor774 iPhone Tips, Help and Troubleshooting 3 May 18, 2012 11:36 AM
Iphone 4 - Microphone and earpiece are not working with phone calls djemyoudjel iPhone Tips, Help and Troubleshooting 1 Nov 25, 2011 02:47 PM
Call Screen Maker - Available Now in App Store AppAnnex iPhone and iPod touch Apps 0 Nov 17, 2011 08:32 AM
3G Video Calls on iPhone 4 a19 iPhone 10 Mar 12, 2011 10:00 AM


All times are GMT -5. The time now is 12:30 AM.

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

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC