小编Ich*_*aki的帖子

在iOS 7中点击UITableView时,所有UITableCell都会消失

我在iOS7中遇到了UITableView的问题.最初,数据加载得很好,我在控制台中输出,证明单元格正确地与数据源对话,但是当我点击表格上的任何位置时,单元格消失,表格变为空白.空UITableView中单元格的高度似乎是为了尊重我的自定义原型单元格(410px),但是单元格中的所有数据都消失了,而空表视图就像它只有一个单元格一样(就像它的默认值一样)在它被连接到代表之前的状态).

我正在为这个应用程序使用Storyboard.

为了获得一点上下文,这个应用程序类似于iphone Instagram应用程序,我正在使用这个应用程序来学习iOS 7开发.我一直在试图解决这个问题,我找不到任何可以帮助我解决这个问题的在线资源,所以我想问Stack Overflow上的所有智能窥视.

我准备了一个图形,可以帮助您查看问题

一个有助于演示问题的图形 更高分辨率版本

这是我的TableViewController代码:

@interface PA_PhotoTableViewController ()

@property (nonatomic, copy) NSArray *photos;

@end



@implementation PA_PhotoTableViewController


- (void)viewDidLoad {
    [super viewDidLoad];
    self.photos = [[PA_PhotoStore sharedPhotoStore] allPhotos];
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [[[PA_PhotoStore sharedPhotoStore] allPhotos] count];
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    PA_PhotoCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PhotoCell" forIndexPath:indexPath];


    PA_Photo *photo = (self.photos)[indexPath.row];

    cell.photoTitle.text = photo.title;
    cell.photoOwnerName.text = [NSString stringWithFormat:@"%@", photo.owner];
    cell.photoLikes.text = @"99";

    // …
Run Code Online (Sandbox Code Playgroud)

objective-c uitableview ios uistoryboard ios7

9
推荐指数
1
解决办法
1393
查看次数

如何在Xcode堆栈跟踪中查找NSInternalInconsistencyException的源代码

我正在使用Objective-C中的iPhone应用程序(使用Xcode 6.1.1和Parse),我只是觉得这个很神秘NSInternalInconsistencyException:

Caught "NSInternalInconsistencyException" with reason "Tried to save an object with a pointer to a new, unsaved object.":

所以我对Stack Overflow社区的问题是:

有人如何读取此堆栈跟踪以查找问题的实际来源?我没有在此堆栈跟踪中的任何位置看到任何可识别的文件名,方法调用或行号.

或者,如果不是简单地读取堆栈跟踪并且涉及其他技术,那么开发人员应该采取哪些适当的下一步来追踪此类错误的来源?

这是输出到我的控制台的完整堆栈跟踪:

2015-07-18 02:01:17.596 testapp[1276:60b] [Error]: Caught "NSInternalInconsistencyException" with reason "Tried to save an object with a pointer to a new, unsaved object.":
(
    0   CoreFoundation                      0x2f547f9b  + 154
    1   libobjc.A.dylib                     0x39c94ccf objc_exception_throw + 38
    2   CoreFoundation                      0x2f547ec5  + 0
    3   testapp                             0x00205a29 -[PFObject(Private) resolveLocalId] + 384
    4   testapp                             0x00233d6d __32-[PFRESTCommand resolveLocalIds]_block_invoke + 24
    5   testapp …

debugging xcode objective-c stack-trace ios

8
推荐指数
1
解决办法
492
查看次数

Objective-C中的typeof()等价物是什么?

有没有一种快速的方法在Objective-C中使用某种类型的typeof()?在Javascript中我可以输入:

var a = "imastring";
console.log(typeof(a));
// --> "string"
Run Code Online (Sandbox Code Playgroud)

我想在Objective-C中清理一些不是编译器指令的东西.

objective-c ios

2
推荐指数
1
解决办法
3404
查看次数