ios - How to put Count so that it won't have warning -


this question has answer here:

i want put count instead of long not work code

nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsarray *locations = @[ @"bottoms", @"dress", @"coats", @"others", @"hats", @"tops" ]; nsstring *fpath = [documentsdirectory stringbyappendingpathcomponent:locations]; nsarray *directorycontent = [[nsfilemanager defaultmanager] directorycontentsatpath: fpath]; collectiontrash.delegate =self; collectiontrash.datasource=self; for(nsstring *str in directorycontent){     nslog(@"i");     nsstring *finalfilepath = [fpath stringbyappendingpathcomponent:str];     nsdata *data = [nsdata datawithcontentsoffile:finalfilepath];     if(data)     {         uiimage *image = [uiimage imagewithdata:data];         [allimagesarray addobject:image];         nslog(@"array:%@",[allimagesarray description]);     }} for(nsstring *folder in locations) {      // folder contents      for(nsstring *file in directorycontent) {          // load image      } }} 

i getting error @ locations in fpath line. saying incompatable pointer types sending nsarray strong parameter of nsstring. how can rid of warning? reaserch have done wrong length. should rolling? compiler warning

2013-08-25 16:21:28.890 [1899:907] -[__nsarrayi length]: unrecognized selector sent       instance 0x1d5458c0     2013-08-25 16:21:28.893 [1899:907] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[__nsarrayi length]: unrecognized selector sent instance 0x1d5458c0'       *** first throw call stack:     (0x32c8b2a3 0x3a96f97f 0x32c8ee07 0x32c8d531 0x32be4f68 0x334fc8c9 0x89ee7 0x34ab2595 0x34b3e353 0x34b7fd11 0x34b7efe7 0x34ca13ef 0x34b7e0c5 0x34b7e077 0x34b7e055 0x34b7d90b 0x34b7de01 0x34aa65f1 0x34a93801 0x34a9311b 0x3679a5a3 0x3679a1d3 0x32c60173 0x32c60117 0x32c5ef99 0x32bd1ebd 0x32bd1d49 0x367992eb 0x34ae7301 0x89c35 0x3ada6b20)     libc++abi.dylib: terminate called throwing exception     (lldb) 

feel free ask if want see more of code

try below code instead of line 4.

nsstring *fpath = documentsdirectory; for(nsstring *component in locations) {     fpath = [fpath stringbyappendingpathcomponent:component]; } 

Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -