开发者

How To Set Nav Bar Item Title From plist's index row?

My data is sourced in a plist and displayed in a tableview with navigation bar.

I want to load the subview with the cell that was clicked.

I know this would set it correct, but I'm not sure how to implement indexPath in the viewDidLoad method?

    self.navigationItem.title = [[self.exerciseArray objectAtIndex:indexPath.row]开发者_如何学PythonobjectForKey: @"name"];


       You have an array of Dictionary With you. Now IndexPath is seen called in TableView delegate methods. I doesn't mean that you can't create one. Create an NSIndexpath obect and assign the indexes parameters and send it to the function which contains the above code( separate the code which sets the title from the Cell for row at index path). 

But the problem is as I see, You want to show only a specific set of data in dictionary which is stored in an Array. The real problem is You should know which the index of the Array you want to load. to the title and the tableview. If you can know that then its solved.

http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSIndexPath_Class/Reference/Reference.html

Regards , Jackson Sunny Rodrigues

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜