一豪叔叔 2019-06-20 16:24 采纳率: 100%
浏览 634
已结题

No visible @interface 已定义方法提示无接口

//
//  ViewController.m
//  day2-11
//
//  Created by Yiling Zheng on 20/06/2019.
//  Copyright © 2019 Yiling Zheng. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
- (IBAction)stand:(id)sender;

- (IBAction)xiaoZhao:(id)sender;
- (IBAction)daZhao:(id)sender;






@property (weak, nonatomic) IBOutlet UIImageView *imageView;

@property (strong,nonatomic)IBOutlet NSMutableArray *standImages;
@property (strong,nonatomic)IBOutlet NSMutableArray *xiaoZhaoImages;
@property (strong,nonatomic)IBOutlet NSMutableArray *daZhaoImages;


@end


@implementation ViewController

//重复代码
- (void)viewDidLoad {
    [super viewDidLoad];

    self.standImages = [self loadImageWithimagePrefix:@"stand" count:10];
    self.xiaoZhaoImages = [self loadImageWithimagePrefix:@"xiaozhao1" count:21];
    self.daZhaoImages = [self loadImageWithimagePrefix:@"dazhao" count:86];



    [self stand];


}
-(NSArray *)loadImageWithimagePrefix:(NSString*)prefix count:(int)count
{
    NSMutableArray<UIImage *> *images= [NSMutableArray array];
    for (int i = 0; i < count; i++) {
        NSString *imageName = [NSString stringWithFormat:@"%@_%d",prefix,i+1];
        UIImage *image = [UIImage imageNamed:imageName];
        [images addObject:image];

    }
    return images;

}




- (IBAction)stand:(id)sender {
    self.imageView.animationImages = self.standImages;
    self.imageView.animationRepeatCount = 0;
    self.imageView.animationDuration = 0.7;
    [self.imageView startAnimating];
}



- (IBAction)xiaoZhao:(id)sender {

    self.imageView.animationImages = self.xiaoZhaoImages;
    self.imageView.animationRepeatCount = 1;
    self.imageView.animationDuration = 1;
    [self.imageView startAnimating];
    //播放完成后再执行站立
    //seclctor:方法,onbject:参数,delay时间
}

- (IBAction)daZhao:(id)sender {



    self.imageView.animationImages = self.daZhaoImages;
    self.imageView.animationRepeatCount = 1;
    self.imageView.animationDuration = 3;
    [self.imageView startAnimating];
}
@end


为什么已经实现了stand方法留在viewdidload方法中,通过[self stand]方法时,依然提示“No visible @interface for 'ViewController' declares the selector 'stand'”??

  • 写回答

3条回答 默认 最新

  • dubiwei 2019-06-20 18:44
    关注

    No visible @interface 什么语言?

    评论

报告相同问题?

悬赏问题

  • ¥50 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?