ios - How to have multiple image paths in array? -
i need display both .png's , .jpg's, unsure of how display both. code below works:
nsarray *imagepaths = [[nsbundle mainbundle] pathsforresourcesoftype:@"png" indirectory:@"carseats"];
but doesn't:
nsarray *imagepaths = [[nsbundle mainbundle] pathsforresourcesoftype:@"png, jpg" indirectory:@"carseats"];
get png , jpg paths separately , combine arrays:
nsarray *pngpaths = [[nsbundle mainbundle] pathsforresourcesoftype:@"png" indirectory:@"carseats"]; nsarray *jpgpaths = [[nsbundle mainbundle] pathsforresourcesoftype:@"jpg" indirectory:@"carseats"]; nsarray *imagepaths = [pngpaths arraybyaddingobjectsfromarray:jpgpaths];
Comments
Post a Comment