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
Post a Comment