Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jrlane

macrumors newbie
Original poster
May 28, 2010
4
0
After an exhaustive search last night and this morning I surrender.

I'm developing a simple quiz application for the iPad based on the splitview template. Everything is coded except for one last thing, instead of forcing the user to select the next question from the menu or popover menu i would like to include a "next" button. As simple as that sounds i have been unable to find a way to do this. Can anyone help?

On a side note: it would also be nice to be able to automatically select the first row "question in my case" upon load. This shouldn't be an issue if i can solve problem one.

Many thanks to all who read this.

Joe.:apple:
 
To be honest I don't know. If you meant it like is it possible i don't know, or can i make that change, yes i can do whatever.
 
Buttons work by sending a message when they are tapped. In the method that is invoked by this message your code can of course do what it likes. So you might have a method called next, and you set your button to send a message to the next selector. In that method you would push a new view controller or update the current view controller or whatever is appropriate for the next message.

Your button might live in a toolbar or a navbar or in a view.
 
This much i know. I have a method that is called when next is pressed. Currently i can use my setDetailItem method inside my DetailViewController to update my view but thats not enough, somehow i also need to change the highlighted table row of my RootViewController, but i do not have access to or don't know what method changes that. How can i send a message to a Different class that i don't have access to the objects that the method needs: heres the method.
Code:
- (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
 
This much i know. I have a method that is called when next is pressed. Currently i can use my setDetailItem method inside my DetailViewController to update my view but thats not enough, somehow i also need to change the highlighted table row of my RootViewController, but i do not have access to or don't know what method changes that. How can i send a message to a Different class that i don't have access to the objects that the method needs: heres the method.
Code:
- (void)tableView:(UITableView *)aTableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

What do you mean you don't have access to it? You have the data source.
Are you talking about manually setting which row is highlighted?
It would be helpful if you posted more code on this subject.
 
I had to solve this recently. What I did was to capture a pointer to the split/popover tableview and all the indexpaths into its table while it was being loaded by calls to cellForRowAtIndexPath .

Then I could call: selectRowAtIndexPath after pulling the required indexpath out of an array where I had them all saved.

There a lots of places to stash data, in singleton model objects, in the app delegate, in C global variables, or any combination of the above.
 
Thanks for the ideas guys! What i thought was there would be an elegant way to do this that apple planned for, apparently its all just a hack.:p
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.