Got memory pressure notification (critical/non-critical) - iOS objetive-c
up vote
0
down vote
favorite
Got memory pressure notification (critical/non-critical).
“n” numbers of images loading from API in tableview. But the app is crashing with above mentioned error after few seconds.
The current code is,
[post_img sd_setImageWithURL:[NSURL URLWithString:[arr objectAtIndex:i]] placeholderImage:[UIImage imageNamed:@"placeHolder.jpg"] options:SDWebImageRefreshCached];
I tried remove cache,
[[SDImageCache sharedImageCache] removeImageForKey:[arr objectAtIndex:i] fromDisk:YES withCompletion:nil];
Also, I tried to fetch images using dispatchqueue,
dispatch_async(dispatch_get_global_queue(0,0), ^{
NSData * data = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString: [arr objectAtIndex:i]]];
if ( data == nil )
return;
dispatch_async(dispatch_get_main_queue(), ^{
post_img.image = [UIImage imageWithData: data];
});
});
But still I getting the error.
ios objective-c image sdwebimage
add a comment |
up vote
0
down vote
favorite
Got memory pressure notification (critical/non-critical).
“n” numbers of images loading from API in tableview. But the app is crashing with above mentioned error after few seconds.
The current code is,
[post_img sd_setImageWithURL:[NSURL URLWithString:[arr objectAtIndex:i]] placeholderImage:[UIImage imageNamed:@"placeHolder.jpg"] options:SDWebImageRefreshCached];
I tried remove cache,
[[SDImageCache sharedImageCache] removeImageForKey:[arr objectAtIndex:i] fromDisk:YES withCompletion:nil];
Also, I tried to fetch images using dispatchqueue,
dispatch_async(dispatch_get_global_queue(0,0), ^{
NSData * data = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString: [arr objectAtIndex:i]]];
if ( data == nil )
return;
dispatch_async(dispatch_get_main_queue(), ^{
post_img.image = [UIImage imageWithData: data];
});
});
But still I getting the error.
ios objective-c image sdwebimage
I think you are testing on some old device. Get rid of that and test on newer one. Also store smaller size image on your server.
– rptwsthi
14 hours ago
three things will happen here 1. may be your image weight is high, 2. your app memory high 3. your device memory is low.
– Anbu.karthik
14 hours ago
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Got memory pressure notification (critical/non-critical).
“n” numbers of images loading from API in tableview. But the app is crashing with above mentioned error after few seconds.
The current code is,
[post_img sd_setImageWithURL:[NSURL URLWithString:[arr objectAtIndex:i]] placeholderImage:[UIImage imageNamed:@"placeHolder.jpg"] options:SDWebImageRefreshCached];
I tried remove cache,
[[SDImageCache sharedImageCache] removeImageForKey:[arr objectAtIndex:i] fromDisk:YES withCompletion:nil];
Also, I tried to fetch images using dispatchqueue,
dispatch_async(dispatch_get_global_queue(0,0), ^{
NSData * data = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString: [arr objectAtIndex:i]]];
if ( data == nil )
return;
dispatch_async(dispatch_get_main_queue(), ^{
post_img.image = [UIImage imageWithData: data];
});
});
But still I getting the error.
ios objective-c image sdwebimage
Got memory pressure notification (critical/non-critical).
“n” numbers of images loading from API in tableview. But the app is crashing with above mentioned error after few seconds.
The current code is,
[post_img sd_setImageWithURL:[NSURL URLWithString:[arr objectAtIndex:i]] placeholderImage:[UIImage imageNamed:@"placeHolder.jpg"] options:SDWebImageRefreshCached];
I tried remove cache,
[[SDImageCache sharedImageCache] removeImageForKey:[arr objectAtIndex:i] fromDisk:YES withCompletion:nil];
Also, I tried to fetch images using dispatchqueue,
dispatch_async(dispatch_get_global_queue(0,0), ^{
NSData * data = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString: [arr objectAtIndex:i]]];
if ( data == nil )
return;
dispatch_async(dispatch_get_main_queue(), ^{
post_img.image = [UIImage imageWithData: data];
});
});
But still I getting the error.
ios objective-c image sdwebimage
ios objective-c image sdwebimage
asked 14 hours ago
john raja
513
513
I think you are testing on some old device. Get rid of that and test on newer one. Also store smaller size image on your server.
– rptwsthi
14 hours ago
three things will happen here 1. may be your image weight is high, 2. your app memory high 3. your device memory is low.
– Anbu.karthik
14 hours ago
add a comment |
I think you are testing on some old device. Get rid of that and test on newer one. Also store smaller size image on your server.
– rptwsthi
14 hours ago
three things will happen here 1. may be your image weight is high, 2. your app memory high 3. your device memory is low.
– Anbu.karthik
14 hours ago
I think you are testing on some old device. Get rid of that and test on newer one. Also store smaller size image on your server.
– rptwsthi
14 hours ago
I think you are testing on some old device. Get rid of that and test on newer one. Also store smaller size image on your server.
– rptwsthi
14 hours ago
three things will happen here 1. may be your image weight is high, 2. your app memory high 3. your device memory is low.
– Anbu.karthik
14 hours ago
three things will happen here 1. may be your image weight is high, 2. your app memory high 3. your device memory is low.
– Anbu.karthik
14 hours ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53371939%2fgot-memory-pressure-notification-critical-non-critical-ios-objetive-c%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I think you are testing on some old device. Get rid of that and test on newer one. Also store smaller size image on your server.
– rptwsthi
14 hours ago
three things will happen here 1. may be your image weight is high, 2. your app memory high 3. your device memory is low.
– Anbu.karthik
14 hours ago