iphone - UIImageView doesn't animate -


i have following code inside app, doesn't animate uiimageview, can tell me why?

    uitableviewcell* cell = [selectedtable cellforrowatindexpath:selectedpath];      nsarray* myimagearray = [nsarray arraywithobjects:                              [uiimage imagenamed:[[nsbundle mainbundle] pathforresource:@"boxbeingchecked117x11" oftype:@"png"]],                              [uiimage imagenamed:[[nsbundle mainbundle] pathforresource:@"boxbeingchecked217x11" oftype:@"png"]],                              [uiimage imagenamed:[[nsbundle mainbundle] pathforresource:@"boxbeingchecked317x11" oftype:@"png"]],                              [uiimage imagenamed:[[nsbundle mainbundle] pathforresource:@"boxbeingchecked417x11" oftype:@"png"]],                              [uiimage imagenamed:[[nsbundle mainbundle] pathforresource:@"boxbeingchecked517x11" oftype:@"png"]],                              [uiimage imagenamed:[[nsbundle mainbundle] pathforresource:@"boxbeingchecked617x11" oftype:@"png"]],                              nil];       cell.imageview.animationimages = myimagearray;     cell.imageview.animationduration = 4.20;     cell.imageview.animationrepeatcount = 1;     [cell.imageview startanimating];     [nstimer scheduledtimerwithtimeinterval:4.0                                      target:self                                    selector:@selector(methodtoinvokeafteranimationisdone)                                    userinfo:nil                                     repeats:no]; 

you should use this:

nsarray* myimagearray = [nsarray arraywithobjects:                              [uiimage imagenamed:@"boxbeingchecked117x11.png"]],                              [uiimage imagenamed:@"boxbeingchecked217x11.png"]],                              [uiimage imagenamed:@"boxbeingchecked317x11.png"]],                              [uiimage imagenamed:@"boxbeingchecked417x11.png"]],                              [uiimage imagenamed:@"boxbeingchecked517x11.png"]],                              [uiimage imagenamed:@"boxbeingchecked617x11.png"]],                              nil]; 

you need give name of file, not path, in imagenamed: method.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -