-1

我想制作自己的SnapchatHax,当我想构建应用程序时出现错误:

Severity    Code    Description Project File    Line    Suppression State
Error       property 'timeIntervalSince1970' not found on object of type 'id'   SnapchatHax (SnapchatHax\SnapchatHax)   C:\re\SnapchatHax-master\SnapchatHax\Snapchat\Internal\SCAPIRequest.m   14  

这是有错误的代码:

//  SCAPIRequest.m
//  SnapchatHax
//
//  Created by Alex Nichol on 12/17/13.
//  Copyright (c) 2013 Alex Nichol. All rights reserved.
//

#import "SCAPIRequest.h"

@implementation SCAPIRequest

+ (NSString *)timestampString {\
    NSTimeInterval time = [NSDate date].timeIntervalSince1970;
    return [NSString stringWithFormat:@"%llu", (unsigned long long)round(time * 1000.0)];
}

感谢大家

4

1 回答 1

0

原因是

[NSDate date] 

正在返回一个 NSDate 类型的对象,并且您已经直接从它访问了 timeIntervalSince1970 ,它是不同类型的。利用

NSTimeInterval value = ((NStimeInterval*)[anArray objectAtIndex:0]).aVariable;

希望你的问题能得到解决

谢谢

于 2016-02-12T09:20:29.937 回答