如何动画存储在sqlite中的图像

时间:2012-11-29 11:05:19

标签: iphone sqlite uiimageview

我有一个UIImageView,我想在其中显示存储在sqlite中的动画的一系列图像。我怎么能这样做?

in。我喜欢..

         UIImageView *photosImgView;

       @property(nonatomic,retain)IBOutlet UIImageView *photosImgView;

在.m我喜欢..

  @synthesize photosImgView;

    - (void)viewDidLoad
        {
            [super viewDidLoad];

            PeopleTable *ppl = [[People alloc] init];

         photosImgView.animationImages=[NSArray arrayWithArray:ppl.photo]; //(problem is   in this line)

       photosImgView.animationDuration = 5;
      photosImgView.animationRepeatCount = 1;
      [photosImgView startAnimating];

     [self.view addSubview:photosImgView];
 }

请帮帮我..谢谢你...

1 个答案:

答案 0 :(得分:0)

使用FMDB,这很容易......

并在你的桌子上做一个循环(选择)

NSMutableArray *imgs = [NSMutableArray array];
FMResultSet *s = [db executeQuery:@"SELECT * FROM myTable"];
while ([s next]) {
    [imgs addObject:[s stringForColumn:@"row"]];
}

photosImgView.animationImages=imgs;

完成!