开发者

how to use plist item as self.title of next view

开发者 https://www.devze.com 2023-03-08 02:16 出处:网络
I have a plist which has an array of items that I display in a UItableView. I want to pass the plist item that is selected to the self.t开发者_JAVA百科itle of the next view, but am unsure how to achie

I have a plist which has an array of items that I display in a UItableView. I want to pass the plist item that is selected to the self.t开发者_JAVA百科itle of the next view, but am unsure how to achieve this.


Setting the title is shorter route for a view controller.

nextViewController.title = [myArray objectAtIndex:indexPath.row];


If it's in an array or dictionary, you can just assign it like any other string.

If this is from the tableView: didSelectRowAtIndexPath: method, then you could do something like the following:

myNextView.navigationItem.title = [myArray objectAtIndex:indexPath.row];
0

精彩评论

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