I am doing a chatting app with JSQmessagecontroller library every thing is working fine but whenever I upload video the page get hang.
I am doing a chatting app with JSQmessagecontroller library every thing is working fine but whenever I upload video the page get hang.
- (id<JSQMessageData>)collectionView:(JSQMessagesCollectionView *)collectionView messageDataForItemAtIndexPath:(NSIndexPath *)indexPath
{
NSString * chat = [[DataArray objectAtIndex:indexPath.row] objectForKey:#"Message"];
NSString * imageurl = [[DataArray objectAtIndex:indexPath.row] objectForKey:#"media"];
if (chat == nil)
{
// NSString *responseString = [[NSString alloc]initWithData:webdata encoding:NSUTF8StringEncoding];
if ([imageurl rangeOfString:#".jpg"].location == NSNotFound) {
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
dispatch_async(dispatch_get_main_queue(), ^{
NSLog(#"Video is Loading....");
image1 =[[UIImageView alloc]init];
MPMoviePlayerController *player1 = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:imageurl]];
[player1 stop];
[self thumbnailImageFromURL:[NSURL URLWithString:imageurl]];
JSQPhotoMediaItem *vitem;
vitem = [[JSQPhotoMediaItem alloc] initWithImage:thumbnailImage];
// NSString * date12=[[DataArray objectAtIndex:indexPath.row] objectForKey:#"date"];
NSString *dateString = [[DataArray objectAtIndex:indexPath.row] objectForKey:#"date"];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:#"dd-MM-YY HH:mm a"];
dateFromString = [[NSDate alloc] init];
dateFromString=[dateFormatter dateFromString:dateString];
messageForRow = [[JSQMessage alloc] initWithSenderId:[[DataArray objectAtIndex:indexPath.row] objectForKey:#"UserId"] senderDisplayName:[[DataArray objectAtIndex:indexPath.row] objectForKey:#"Name"]date:[[DataArray objectAtIndex:indexPath.row] objectForKey:#"date"] media:vitem] ;
// JSQPhotoMediaItem *vitem = [[JSQPhotoMediaItem alloc] initWithImage:thumbnailImage];
});
});
}
else
{
image1 =[[UIImageView alloc]init];
UIImage *im=[[UIImage alloc]init];
[image1 sd_setImageWithURL:[NSURL URLWithString:imageurl]
placeholderImage:nil];
im=image1.image;
JSQPhotoMediaItem *item = [[JSQPhotoMediaItem alloc] initWithImage:im];
NSString *dateString = [[DataArray objectAtIndex:indexPath.row] objectForKey:#"date"];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:#"dd-MM-YY HH:mm a"];
//dateFromString = [[NSDate alloc] init];
dateFromString=[dateFormatter dateFromString:dateString];
messageForRow = [[JSQMessage alloc] initWithSenderId:[[DataArray objectAtIndex:indexPath.row] objectForKey:#"UserId"] senderDisplayName:[[DataArray objectAtIndex:indexPath.row] objectForKey:#"Name"] date:[[DataArray objectAtIndex:indexPath.row] objectForKey:#"date"] media:item] ;
}
}
else
{
messageForRow = [[JSQMessage alloc] initWithSenderId:[[DataArray objectAtIndex:indexPath.row] objectForKey:#"UserId"] senderDisplayName:[[DataArray objectAtIndex:indexPath.row] objectForKey:#"Name"] date:[[DataArray objectAtIndex:indexPath.row] objectForKey:#"date"] text: [[DataArray objectAtIndex:indexPath.row] objectForKey:#"Message"]] ;
}
return messageForRow;
}
Related
I have an app where I am picking a video from a photo library and I want to get the date and time it was created (and if possible the location it was taken) from its metadata so I can use it for some labeling. I can do it for an image picked from the photo library but it doesn't work with a video. Here is what I have for the image but I can't seem to adapt it to a video.
So I did some adapting like this:
//I get the video from the photo library
if (picker.sourceType ==UIImagePickerControllerSourceTypePhotoLibrary) {
NSLog(#"info:%#",info);
NSURL * movieURL = [info valueForKey:UIImagePickerControllerMediaURL] ;
NSData * movieData = [NSData dataWithContentsOfURL:movieURL];
//I save it to the documentsDirectory and get an image at the half way point
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [documentPaths objectAtIndex:0];
NSString *slash = [documentsDirectory stringByAppendingPathComponent:#"/"];
NSString *documentsDirectory2 = [slash stringByAppendingPathComponent:self.user.text];
NSString *documentsDirectory21 = [documentsDirectory2 stringByAppendingPathComponent:#"/Movie"];
if (![[NSFileManager defaultManager] fileExistsAtPath:documentsDirectory21])
[[NSFileManager defaultManager] createDirectoryAtPath:documentsDirectory21 withIntermediateDirectories:NO attributes:nil error:&error];
NSString *fullPath = [documentsDirectory21 stringByAppendingPathComponent:[[self imageNameTextField]text]];
fullPath = [fullPath stringByAppendingFormat:#".mp4"];
[ movieData writeToFile:fullPath atomically:YES];
AVURLAsset *anAsset = [[AVURLAsset alloc] initWithURL:movieURL options:nil];
//this is what I changed
PHAsset *theAsset = [info valueForKey:UIImagePickerControllerMediaURL] ;
NSLog(#"creationDate1:%#",theAsset);
NSLog(#"creationDate2:%#",anAsset.creationDate.value);
NSDate *creationDate =(NSDate *)anAsset.creationDate.value;
NSDateFormatter *dateFormatter=[[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:#"MMMM-dd-yyyy"];
dayString = [dateFormatter stringFromDate:creationDate];
NSDateFormatter *dateFormatter2=[[NSDateFormatter alloc] init];
[dateFormatter2 setDateFormat:#"hh:mm a"];
timeString = [dateFormatter2 stringFromDate:creationDate];
if ([[anAsset tracksWithMediaType:AVMediaTypeVideo] count] > 0) {
AVAssetImageGenerator *imageGenerator =
[AVAssetImageGenerator assetImageGeneratorWithAsset:anAsset];
Float64 durationSeconds = CMTimeGetSeconds([anAsset duration]);
CMTime midpoint = CMTimeMakeWithSeconds(durationSeconds/2.0, 600);
NSError *error;
CMTime actualTime;
CGImageRef halfWayImage = [imageGenerator copyCGImageAtTime:midpoint actualTime:&actualTime error:&error];
if (halfWayImage != NULL) {
NSString *actualTimeString = (NSString *)CFBridgingRelease(CMTimeCopyDescription(NULL, actualTime));
NSString *requestedTimeString = (NSString *)CFBridgingRelease(CMTimeCopyDescription(NULL, midpoint));
NSLog(#"Got halfWayImage: Asked for %#, got %#", requestedTimeString, actualTimeString);
myImage.image = [UIImage imageWithCGImage:halfWayImage scale:1.0 orientation:UIImageOrientationRight];
// Do something interesting with the image.
CGImageRelease(halfWayImage);
}
}
what I had here before I discarded.
So I finally figured this out. By putting the following code after
AVURLAsset *anAsset = [[AVURLAsset alloc] initWithURL:movieURL options:nil];
PHAsset *theAsset = [info valueForKey:UIImagePickerControllerMediaURL] ;
NSLog(#"creationDate1:%#",theAsset);
NSLog(#"creationDate2:%#",anAsset.creationDate.value);
NSDate *creationDate =(NSDate *)anAsset.creationDate.value;
NSDateFormatter *dateFormatter=[[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:#"MMMM-dd-yyyy"];
dayString = [dateFormatter stringFromDate:creationDate];
NSDateFormatter *dateFormatter2=[[NSDateFormatter alloc] init];
[dateFormatter2 setDateFormat:#"hh:mm a"];
timeString = [dateFormatter2 stringFromDate:creationDate];
I've changed my original post to reflect the changes.
Now if I could just get the metadata for location from the asset I'd be all set.
Made 3 view controllers. FIRST with the name vc1 and second with vc2 and third with vc3. in vc1 there is some textfield data and in vc2 there are some image views and buttons under it, these images first to convert to base64.Third vc it also have some text field now i want to submit all the data from textfield of vc1 and vc3 and all the images from vc2 with time in milliseconds to a php web service. I have written some code but I'm not getting any response. can anyone help me plzz. My code is:
enter code here`NSString *dateString1 = #"16-05-2017 14:35";
NSDateFormatter *dateFormatter1 = [[NSDateFormatter alloc] init];
[dateFormatter1 setDateFormat:#"dd-MM-yyyy HH:mm"];
NSDate *dateFromString1 = [[NSDate alloc] init];
dateFromString1 = [dateFormatter1 dateFromString:dateString1];
NSTimeInterval timeInMiliseconds1 = [dateFromString1 timeIntervalSince1970]*1000;
NSString *timestamp1=[NSString stringWithFormat:#"%f",timeInMiliseconds1];
NSLog(#"time in mililsecond is %.00f",timeInMiliseconds1);
NSString *dateString2 = #"16-05-2017 14:35";
NSDateFormatter *dateFormatter2 = [[NSDateFormatter alloc] init];
[dateFormatter2 setDateFormat:#"dd-MM-yyyy HH:mm"];
NSDate *dateFromString2 = [[NSDate alloc] init];
dateFromString2 = [dateFormatter2 dateFromString:dateString2];
NSTimeInterval timeInMiliseconds2 = [dateFromString2 timeIntervalSince1970]*1000;
NSString *timestamp2=[NSString stringWithFormat:#"%f",timeInMiliseconds2];
NSLog(#"time in mililsecond is %.00f",timeInMiliseconds2);
NSString *dateString3 = #"16-05-2017 14:35";
NSDateFormatter *dateFormatter3 = [[NSDateFormatter alloc] init];
[dateFormatter3 setDateFormat:#"dd-MM-yyyy HH:mm"];
NSDate *dateFromString3 = [[NSDate alloc] init];
dateFromString3 = [dateFormatter3 dateFromString:dateString3];
NSTimeInterval timeInMiliseconds3 = [dateFromString3 timeIntervalSince1970]*1000;
NSString *timestamp3=[NSString stringWithFormat:#"%f",timeInMiliseconds3];
NSLog(#"time in mililsecond is %.00f",timeInMiliseconds3);
NSString *dateString4 = #"16-05-2017 14:35";
NSDateFormatter *dateFormatter4 = [[NSDateFormatter alloc] init];
[dateFormatter4 setDateFormat:#"dd-MM-yyyy HH:mm"];
NSDate *dateFromString4 = [[NSDate alloc] init];
dateFromString4 = [dateFormatter4 dateFromString:dateString4];
NSTimeInterval timeInMiliseconds4 = [dateFromString4 timeIntervalSince1970]*1000;
NSString *timestamp4=[NSString stringWithFormat:#"%f",timeInMiliseconds4];
NSLog(#"time in mililsecond is %.00f",timeInMiliseconds4);
NSString *dateString5 = #"16-05-2017 14:35";
NSDateFormatter *dateFormatter5 = [[NSDateFormatter alloc] init];
[dateFormatter5 setDateFormat:#"dd-MM-yyyy HH:mm"];
NSDate *dateFromString5 = [[NSDate alloc] init];
dateFromString5 = [dateFormatter5 dateFromString:dateString5];
NSTimeInterval timeInMiliseconds5 = [dateFromString5 timeIntervalSince1970]*1000;
NSString *timestamp5=[NSString stringWithFormat:#"%f",timeInMiliseconds5];
NSLog(#"time in mililsecond is %.00f",timeInMiliseconds5);
NSString *dateString6 = #"16-05-2017 14:35";
NSDateFormatter *dateFormatter6 = [[NSDateFormatter alloc] init];
[dateFormatter6 setDateFormat:#"dd-MM-yyyy HH:mm"];
NSDate *dateFromString6 = [[NSDate alloc] init];
dateFromString6 = [dateFormatter6 dateFromString:dateString6];
NSTimeInterval timeInMiliseconds6 = [dateFromString6 timeIntervalSince1970]*1000;
NSString *timestamp6=[NSString stringWithFormat:#"%f",timeInMiliseconds6];
NSLog(#"time in mililsecond is %.00f",timeInMiliseconds6);
NSString *post = [NSString stringWithFormat:#"name=%#&email=%#&phone=%#&propertytitle=%#&propertyfor=%#&propertytype=%#&propertyprice=%#&propertyavail=%#&landarea=%#&noofrooms=%#&noofbathrooms=%#&nooffloors=%#&description=%#&structureofproperty=%#&structureofflooring=%#&wallsstructure=%#&doorsstructure=%#&=electricalstructure=%#&location=%#&country=%#&city=%#&imgurl1=%#×tamp1=%#&imgurl2=%#×tamp2=%#&imgurl3=%#×tamp3=%#&imhurl4=%#×tamp4=%#&imgurl5=%#×tamp5=%#&imgurl6=%#×tamp6%#",_name.text,_email.text,_Phone.text,_propertytitle,_propertyfor,_propertytype,_propertyprice,_propertyavail,_landarea,_noofrooms,_noofbathrooms,_nooffloors,self.description,_structureofproperty,_structureofflooring,_wallsstructure,_doorsstructure,_electricalstructure,_Location,_but1.titleLabel.text,_but2.titleLabel.text,_imgurl1,timestamp1,_imgurl2,timestamp2,_imgurl3,timestamp3,_imgurl4,timestamp4,_imgurl5,timestamp5,_imgurl6,timestamp6];
NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];
NSString *postLength = [NSString stringWithFormat:#"%d", [postData length]];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:#" my url"]];
[request setHTTPMethod:#"POST"];
[request setValue:postLength forHTTPHeaderField:#"Content-Length"];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
[[session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSString *requestReply = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
NSLog(#"requestReply: %#", requestReply);
resume];
I'm relatively new to iOS development and my current project requires me to Connect to a website through a Rest API, and use JSON Objects received from the site to populate a Custom UITableViewController which I have implemented. I have been able to download the information and get it to display on the table properly, but this requires me to enter the page which starts the download, then leave the page and enter it again, upon which all of the cells are populated. How can I make my app load this information without leaving the page?
My Custom UITableViewClass contains the following methods:
- (void)viewDidLoad {
[super viewDidLoad];
NSString *chuckFranklinConnection = #"http://chuckfranklinlaw.com/wp-json/posts?type=tribe_events";
NSURLSession *session = [NSURLSession sharedSession];
[[session dataTaskWithURL: [NSURL URLWithString:chuckFranklinConnection]
completionHandler:^(NSData *data,
NSURLResponse *response,
NSError *error){
//Complete Data Handling from Chuckfranklinlaw.com Here
NSString *responseData = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSError *e = nil;
jsonArray = [NSJSONSerialization JSONObjectWithData: data options:NSJSONReadingMutableContainers error: &e];
if(!jsonArray) {
NSLog(#"Error parsing JSON: %#", e);
}else {
NSLog(#"Begin Successful Parse Readout -----------");
for(NSDictionary *item in jsonArray) {
NSLog(#"Item: %#", item);
}
}
}]
resume];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<##"reuseIdentifier"#> forIndexPath:indexPath];
// Configure the cell...
EventTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:#"EventsCell"];
if(cell == nil) {
cell = [[EventTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:#"EventsCell"];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
//Formatting for each Cell Title
cell.textLabel.lineBreakMode = NSLineBreakByWordWrapping;
cell.textLabel.numberOfLines = 0;
cell.textLabel.text = [[jsonArray objectAtIndex:indexPath.row] objectForKey: #"title"];
//Formatting for each Cell Detail
NSString *startDate = [[jsonArray objectAtIndex:indexPath.row] objectForKey: #"StartDate"];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:#"yyyy-MM-dd HH:mm:ss"];
NSDate *date = [dateFormatter dateFromString:startDate];
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
[dateFormatter setTimeStyle:NSDateFormatterShortStyle];
cell.data = [[jsonArray objectAtIndex:indexPath.row] objectForKey:#"ID"];
cell.detailTextLabel.text = [dateFormatter stringFromDate:date];
//Work On Implementing Image View for App in this section
NSDictionary *imageInfo = [[jsonArray objectAtIndex:indexPath.row] objectForKey:#"featured_image"];
NSDictionary *attachmentMeta = [imageInfo objectForKey:#"attachment_meta"];
NSDictionary *sizes = [attachmentMeta objectForKey:#"sizes"];
NSDictionary *thumbnail = [sizes objectForKey:#"thumbnail"];
NSString *url = [thumbnail objectForKey:#"url"];
NSLog(url);
UIImage* image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:url]]];
cell.imageView.image = image;
return cell;
[cell setNeedsDisplay];
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if([segue.identifier isEqualToString:#"showEventDetail"])
{
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
DetailViewController *detailView = segue.destinationViewController;
NSString *contentString = [[jsonArray objectAtIndex:indexPath.row] objectForKey:#"content"];
//The Following code mutates the HTML Strings recieved from the server into NSStrings for displaying
contentString = [contentString stringByReplacingOccurrencesOfString:#"’" withString:#"\'"];
contentString = [contentString stringByReplacingOccurrencesOfString:#"<p>" withString:#""];
contentString = [contentString stringByReplacingOccurrencesOfString:#"</p>" withString:#"\n"];
detailView.content = contentString;
detailView.title = [[jsonArray objectAtIndex:indexPath.row] objectForKey:#"title"];
NSString *startDate = [[jsonArray objectAtIndex:indexPath.row] objectForKey:#"StartDate"];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:#"yyyy-MM-dd HH:mm:ss"];
NSDate *date = [dateFormatter dateFromString:startDate];
[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
[dateFormatter setTimeStyle:NSDateFormatterShortStyle];
detailView.eventTime = [dateFormatter stringFromDate:date];
//Pull Image from web and serve to next page
NSDictionary *imageInfo = [[jsonArray objectAtIndex:indexPath.row] objectForKey:#"featured_image"];
NSDictionary *attachmentMeta = [imageInfo objectForKey:#"attachment_meta"];
NSDictionary *sizes = [attachmentMeta objectForKey:#"sizes"];
NSDictionary *blogFull = [sizes objectForKey:#"blog-full"];
NSString *url = [blogFull objectForKey:#"url"];
detailView.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:url]]];
}
}
In your completion block: [self.tableview reloadData]. Documentation.
Actually, you will want to create a weak reference to self, then use the weak reference in your completion block.
i am trying to increment date and year from calendar, but it is incrementing only one value which means (it is incrementing from jan to feb, but it is not incrementing after feb) my requirement is to incrementing upto 12 month and also simultaneously year has to increment. could you please tell me how to resolve this issue this is my code
- (IBAction)right:(id)sender {
[datearray removeAllObjects];
NSCalendar *cal = [NSCalendar currentCalendar];
date = [cal dateByAddingUnit:NSCalendarUnitMonth value:1 toDate:[NSDate date] options:0];
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:#"MMM YYYY"];
NSString *stringFromDate = [formatter stringFromDate:date];
yar.text=stringFromDate;
NSString *y1=yar.text;
NSArray * arr = [y1 componentsSeparatedByString:#" "];
NSString *m=arr[0];
NSString *yy=arr[1];
spinner = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
spinner.mode = MBProgressHUDModeCustomView;
[spinner setLabelText:#"Loading....."];
[spinner setLabelFont:[UIFont systemFontOfSize:15]];
[spinner show:YES];
//[self.coutweek setText:[NSString stringWithFormat:#"%d",week]];
NSString *urlString = [NSString stringWithFormat:#"http://edvancepreschoolsadminpanel.com/viverobranch/json/json_lunch.php?key=agile89rise98&food=%#&month=%#&year=%#&username=%#",scl,m,yy,temp];
NSLog(#"the url string==%#",urlString);
NSURL *url = [NSURL URLWithString:urlString];
NSString *jsonString = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil];
NSLog(#"the str==%#",jsonString);
NSDictionary *results = [NSJSONSerialization JSONObjectWithData:[jsonString dataUsingEncoding:NSUTF8StringEncoding] options:0 error:nil];
NSLog(#"%#",results);
luncharray = [[NSMutableArray alloc]init];
NSArray *array=[results objectForKey:#"lunch_menu"];
for (int i=0; i<[array count]; i++) {
NSString *dat =[[array objectAtIndex:i]objectForKey:#"date"];
NSString *mon =[[array objectAtIndex:i]objectForKey:#"month"];
NSString *yea =[[array objectAtIndex:i]objectForKey:#"year"];
NSString *luh =[[array objectAtIndex:i]objectForKey:#"food"];
NSString *tim =[[array objectAtIndex:i]objectForKey:#"time"];
ipadlunch *myimg =[[ipadlunch alloc]initWithdat:dat andmon:mon andyea:yea andlunch:luh andtime:tim];
NSLog(#"%#",myimg);
[luncharray addObject:myimg];
// NSLog(#"the field==%#",videoarray1);
}
Very slowly scroll on UITableView images.Help me please.
Did not find the right solution
My code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *const ImageCellId = #"ImageCell";
EXImageCell *cell = [tableView dequeueReusableCellWithIdentifier:ImageCellId];
RSSItem *item = [_data objectAtIndex:indexPath.row];
cell.cellTextLabel.text = item.title;
cell.cellTimeTextLabel.text = [NSDateFormatter localizedStringFromDate:item.pubDate dateStyle:NSDateFormatterMediumStyle timeStyle:NSDateFormatterShortStyle];
cell.cellAuthor.text = [NSString stringWithFormat:#"Author: %#", item.author];
NSURL *tutorialsUrl = item.link;
NSData *tutorialsHtmlData = [NSData dataWithContentsOfURL:tutorialsUrl];
TFHpple *tutorialsParser = [TFHpple hppleWithHTMLData:tutorialsHtmlData];
NSString *tutorialsXpathQueryString = #"//div[#class='photo']/img";
NSArray *tutorialsNodes = [tutorialsParser searchWithXPathQuery:tutorialsXpathQueryString];
//NSMutableArray *newTutorials = [[NSMutableArray alloc] initWithCapacity:0];
for (TFHppleElement *element in tutorialsNodes) {
tutorial = [[Tutorial alloc] init];
//[newTutorials addObject:tutorial];
//tutorial.title = [[element firstChild] content];
tutorial.url = [element objectForKey:#"src"];
}
NSData *data = [NSData dataWithContentsOfURL : [NSURL URLWithString:tutorial.url]];
UIImage *imageMain = [UIImage imageWithData:data];
[cell.cellImageView setImage:imageMain];
return cell;
}
PS: dispatch_async tried to use, but to no avail