ios - Getting Warning with Parse.com -
i'm triying access each item on nsarray trough enumerateobjectsusingblock, since allow me utilize fast enumration , evaluating index.
when utilize findobjectsinbackgroundwithblock,
i warning: long-running operation beingness executed on main thread. break on warnblockingoperationonmainthread() debug.
as thought used in background not block mainthread. here code , i'm triying accomplish have 2 uiimageview container i'm pulling images result of relation on query. since there container tought improve evaluate index of nsarray.
not sure how can remedy warning.
thanks
[query findobjectsinbackgroundwithblock:^(nsarray *objects, nserror *error) { if (objects != 0) { [objects enumerateobjectsusingblock:^(pfuser *object, nsuinteger idx, bool *stop) { if (idx == 0) { pffile *userprofile = [object objectforkey:@"userpic"]; cell.promoter1.file = userprofile; cell.promoter1.contentmode = uiviewcontentmodescaleaspectfit; [cell.promoter1 loadinbackground]; cell.promoter1name.textalignment = nstextalignmentcenter; cell.promoter1name.linebreakmode = nslinebreakbywordwrapping; } if (idx == 1) { pffile *userprofile = [object objectforkey:@"userpic"]; cell.promoter2.file = userprofile; cell.promoter2.contentmode = uiviewcontentmodescaleaspectfit; [cell.promoter2 loadinbackground]; nsattributedstring *promoter1name; cell.promoter2name.textalignment = nstextalignmentcenter; *stop = yes; } }]; } }];
troubleshooting code, realized findobjectsinbackgroundwithblock
not cause warning.
on part of code had this:
pfuser *user = [pfquery getuserobjectwithid:@"ebwfrl8pcf"]; [relation addobject:user]; [self.event saveinbackground];
which block main thread.
i apologize.
ios objective-c parse.com cell fast-enumeration
No comments:
Post a Comment