小编Til*_*ill的帖子

使用未声明的标识符'AppDelegate'

为什么我使用此代码收到此错误消息?"使用未声明的标识符'AppDelegate'

int main(int argc, char *argv[])
{
    @autoreleasepool {
        return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    }
}
Run Code Online (Sandbox Code Playgroud)

iphone ios xcode4.2

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

Salesforce 系统计划作业未执行

我创建了一个名为 scheduleInsert 的调度程序类。此类的调度程序作业使用以下代码注册

public class TestInsertTaskScheduler
{
  public static testMethod void testInsertTaskScheduler()
  {
     scheduledInsert i = new scheduledInsert();
     Datetime now = Datetime.now();
     System.debug ('Datetime'+now);
     String sch = '0 1 * * * ?';  // scheduled to execute every minute
     system.schedule('Insert Task S3', sch, i);
     System.debug ('After schedule');
   }
}
Run Code Online (Sandbox Code Playgroud)

预定的班级代码是

global class scheduledInsert implements Schedulable 
{
  global void execute(SchedulableContext SC)
  {
    System.debug('scheduled insert'); 
  }
}
Run Code Online (Sandbox Code Playgroud)

此作业(插入任务 S3)不会显示在监控计划作业下。

此外,作业根本不执行。

我犯了什么错误?

salesforce scheduled-tasks

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

UIScrollView不显示滚动条(滚动指示符)

我有UIScrollView,我以编程方式填充UIImageViews.之后,我更改了scrollview的contentSize,以便我可以滚动它.它工作正常,但我没有看到滚动条,它困扰我.我已设置在.xib中显示它们,我甚至以编程方式设置"showHorizo​​ntalScrollIndicator"属性,但我仍然看不到滚动条.

有谁知道为什么我看不到滚动条以及如何让它们出现?

顺便说一下,我并不是说我不想在任何时候看到它们,我只是想要标准的行为,但即使我在滚动它们也不会显示它们.

cocoa-touch objective-c uiscrollview uikit ios

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

如何创建UIScrollView?

我在UIViewController上有4个标签.现在我想知道如何使用UIScrollView将当前视图设置为可滚动视图?

uiscrollview uikit ios

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

当我重复使用它时,如何完全清除细胞?

当我打电话给[table reloaddata];

用新数据重新绘制单元格,但是我的UILabel搞砸了,因为它们是在旧的UILabel上绘制的,所以它很乱.

    static NSString* PlaceholderCellIdentifier = @"PlaceholderCell";

UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:PlaceholderCellIdentifier];


if (cell == nil)
{
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:PlaceholderCellIdentifier] autorelease];   
    cell.detailTextLabel.textAlignment = UITextAlignmentCenter;
    cell.selectionStyle = UITableViewCellSelectionStyleNone;


    cell.contentView.backgroundColor = [UIColor clearColor];
}
Run Code Online (Sandbox Code Playgroud)

是我的细胞的初始化.

我像这样添加一个UILabel

        UILabel *theDateLabel = [[UILabel alloc] initWithFrame:CGRectMake(140, 35,140, 20)];
    [theDateLabel setBackgroundColor:[UIColor clearColor]];
    [theDateLabel setTextColor:[UIColor lightGrayColor]];
    [theDateLabel setText:[dateFormatter stringFromDate:theDate]];
    [theDateLabel setFont:[UIFont fontWithName:@"TrebuchetMS-Bold" size:15]];
    [cell addSubview:theDateLabel];
    [theDateLabel release];
Run Code Online (Sandbox Code Playgroud)

细胞中还有一些标签,同样的东西.

我想要发生的是旧标签从单元格中消失,以便它们不再可见.

objective-c uitableview uikit ios

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

UIPanGestureRecognizer没有顺利移动对象

我试图使用UIPanGestureRecognizer移动我的对象,但我似乎无法让它顺利移动.当我向特定方向移动并向相反方向移动时,它不会立即作出反应.我假设值可能有问题,因为它在" - >"方向为正,在"< - "方向为负.

我的代码如下:

- (void)panDetected:(UIPanGestureRecognizer *)panRecognizer
    {    
        CGPoint pointA = [panRecognizer locationInView:self.view];
        CGPoint pointB = [panRecognizer translationInView:self.view];

        if(panRecognizer.state == UIGestureRecognizerStateEnded ||
           panRecognizer.state == UIGestureRecognizerStateChanged) {     
            _camera.x += pointB.x * 0.0001f;
        }
    }
Run Code Online (Sandbox Code Playgroud)

有没有人有更合适的方法来解决这个问题?

提前致谢.

uikit uigesturerecognizer ios uipangesturerecognizer

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

无法调试c ++项目因为无法启动静态库启动程序*.lib

我正在使用一个我没有问题的库(Astro.lib)(我想这是一个发布版本).

我还内置了一个项目,引用库(它会作为一个发布EXE罚款),但因为我得到的消息"无法启动程序'Astro.lib’我不能调试项目.

如果我尝试调试lib然后我得到相同的错误,所以我猜它与没有构建调试我的lib但不知道如何修改有关.

我尝试使用MSDN信息更改属性页但不确定我是否正在解决正确的问题.我应该对链接项目库的属性页进行哪些更改?

提前致谢

c++ debugging static-libraries visual-c++

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

动画结束时会变慢

我有一个翻译动画,将我的按钮从A移动到B.

那条路线看起来像这样:

1)按钮缓慢加速2)在动画中间达到速度的峰值3)当它接近结束时减速

这是我的代码

[UIView animateWithDuration:speed
                      delay:delay
                    options:UIViewAnimationOptionAllowUserInteraction
                 animations:^(void){
                     [UIView setAnimationRepeatCount:5];
                     cloud.frame = (CGRectMake(cloud.frame.origin.x,   
cloud.frame.origin.y+900, cloud.frame.size.width, cloud.frame.size.height));

                 }completion:nil];
Run Code Online (Sandbox Code Playgroud)

我希望我的动画始终具有相同的速度.

我怎样才能做到这一点?

objective-c uikit uianimation ios

0
推荐指数
1
解决办法
1089
查看次数

MediaPlayer 使用 DropBox URL 播放视频

嗨,我正在为一个需要我从服务器播放视频的 uni 项目创建一个应用程序。我决定使用 Dropbox。但是它不会播放文件,我有什么办法可以做到吗?还是我需要从其他地方获取视频。

我试过另一个链接,它工作得很好。(但不是保管箱)

http://www.jplayer.org/video/m4v/Big_Buck_Bunny_Trailer.m4v

我的编码如下

AnimeWatchViewController.m

//
//  AnimeWatchViewController.m
//  VideoPlayer
//
//  Created by Alex Lee on 27/04/2014.
//  Copyright (c) 2014 Alex Lee. All rights reserved.
//

#import "AnimeWatchViewController.h"

@interface AnimeWatchViewController ()

@end

@implementation AnimeWatchViewController

@synthesize moviePlayer;

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.


}

-(IBAction)playMovie{

    NSURL * url =[[NSURL alloc] initWithString:@"https://www.dropbox.com/s/t05zdw2woogo4kh/ACW_3.mp4"];

    moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];

    [moviePlayer.view setFrame:CGRectMake(20, 100, 275, 150)];
    [self.view addSubview:moviePlayer.view];

    moviePlayer.fullscreen …
Run Code Online (Sandbox Code Playgroud)

video objective-c dropbox mpmovieplayercontroller ios

0
推荐指数
1
解决办法
1415
查看次数

为什么会出现内存损坏...只有当我们不打印变量被破坏时?

我在C中有一个奇怪的错误.我们有以下代码,我首先尝试了它没有中间两个fprintf(f, "Passed PKLEN pklen: %u ,params->pklen: %u \n", pklen, params->pklen);函数,并且得到了看起来像内存损坏,pklen停止等于params->pklen.当我添加这两个中间部分println以确定实际腐败发生的位置时...两者相等于最后一个.

void ntru_get_seed(uint8_t *msg, uint16_t msg_len, NtruIntPoly *h, uint8_t *b, const NtruEncParams *params, uint8_t *seed) {
  FILE *f = fopen("log.txt", "a");
  uint16_t oid_len = sizeof params->oid;
  uint16_t pklen = params->pklen;
  fprintf(f, "Passed PKLEN pklen: %u ,params->pklen: %u \n", pklen, params->pklen);
  fflush(f);
?
  uint8_t bh[ntru_enc_len(params)];
  fprintf(f, "Passed PKLEN pklen: %u ,params->pklen: %u \n", pklen, params->pklen);

  ntru_to_arr(h, params->q, (uint8_t*)&bh);
  fprintf(f, "Passed PKLEN pklen: %u ,params->pklen: …
Run Code Online (Sandbox Code Playgroud)

c memory-corruption

0
推荐指数
1
解决办法
127
查看次数