gpt4 book ai didi

ios - 我的 iPad Storyboard上的详细 View 未填充

转载 作者:行者123 更新时间:2023-11-29 02:42:42 25 4
gpt4 key购买 nike

Stack Overflow 上有一百万个问题,但没有一个对我有用。

我的应用程序在 iPhone 上运行良好。我有一个 tableView,当我 segue 时,数据移动正常。

对于 iPad,我没有在 splitView 中获取详细数据。但是当我记录 detailView 对象时,我看到以下内容:

2014-08-28 17:44:26.298 GuessGreek[59754:607] -[WordViewController tableView:didSelectRowAtIndexPath:]
2014-08-28 17:44:26.299 GuessGreek[59754:607] -[WordDetailsViewController viewDidLoad]
2014-08-28 17:44:26.300 GuessGreek[59754:607] detailItem 1<WordEntity: 0x786853e0> (entity: WordEntity; id: 0x78685810 <x-coredata://B2B61C41-1855-46EB-AA5E-04697CA6B025/WordEntity/p1454> ; data: {
category = uncategorized;
changeFlag = nil;
englishScore = 0;
englishText = "unmarried, single";
example = nil;
favorite = nil;
greekScore = 0;
greekText = "\U03ac\U03b3\U03b1\U03bc\U03bf\U03c2-\U03b7-\U03bf";
type = Adjective;
uid = 1454;
})

2014-08-28 17:44:26.302 GuessGreek[59754:607] 1 greekTextField: (null)
2014-08-28 17:44:26.303 GuessGreek[59754:607] 1 englishTextField: (null)

详细信息对象看起来已填充,但当我记录单个组件时,它们是空白的。

我的代码如下:

Word View

iPad:

> -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
> if (_IPAD) {
>
> id object;
> if (self.searchResults.count > 0)
> {
> object = [self.searchResults objectAtIndex:indexPath.row];
> [self.searchDisplayController setActive:NO];
> }
> else
> {
> object = [self.fetchedResultsController objectAtIndexPath:indexPath];
>
> }
>
> wordDetailsViewController.detailItem = object;
> [wordDetailsViewController viewDidLoad];
>
> } }

iPhone:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"wordToDetails"])

NSIndexPath *indexPath = [self.searchDisplayController.searchResultsTableView indexPathForCell:(UITableViewCell *)sender];

id object;
if (indexPath != nil)
{
object = [self.searchResults objectAtIndex:indexPath.row];
[self.searchDisplayController setActive:NO];
}
else
{
indexPath = [self.wordTable indexPathForCell:(UITableViewCell *)sender];
object = [self.fetchedResultsController objectAtIndexPath:indexPath];

}


WordDetailsViewController *destinationController = segue.destinationViewController;

destinationController.detailItem = object;

}
}

DetailView - viewDidLoad

    NSLog(@"detailItem 1%@", detailItem);
self.greekTextField.text = [self.detailItem valueForKey:@"greekText"];
self.englishTextField.text = [self.detailItem valueForKey:@"englishText"];

最佳答案

如果您使用核心数据的@dynamic 属性会怎么样?

self.greekTextField.text = self.detailItem.greekText;    
self.englishTextField.text = self.detailItem.englishText;

关于ios - 我的 iPad Storyboard上的详细 View 未填充,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25552145/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com