objective c - Add UIImage to NSMutableArray -


i have problem piece of code should add images nsmutablearray. reason images not added (the count of array stays @ 0). can please tell me i'm doing wrong here?

- (void)incomingnotification:(nsnotification *)notification {     [self.popovercontroller dismisspopoveranimated:yes];     _urlstring = [notification object];      (int = 0; < [[self returnlargeurls] count]; i++) {         [self getimagefromurl:_urlstring];     } } 

and in getimagefromurl::

-(nsdata *) getimagefromurl:(nsstring *)fileurl {     uiimage *result;     nsdata *data = [nsdata datawithcontentsofurl:[nsurl urlwithstring:fileurl]];     result = [uiimage imagewithdata:data];      [self.pageimages addobject:result];      nslog(@"%d", self.pageimages.count);     return data; } 

the first thing check property pageimages not nil begin with.

you can check like:

if(!pageimages)     nslog(@"the nsmutablearray pageimages nil. damn... :("); 

this problem.


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -