Comments (7)
What's ur lib version used? Have u add reference of Photos.framework
? Plz take a look at this issue (#16) first, maybe will helps.
from alassetslibrary-customphotoalbum.
Yes i import Photos.framework. and i use the last versión. The code allways pass for this else
else {
// code that always creates an album on iOS 7.x.x but fails
// in certain situations such as if album has been deleted
// previously on iOS 8.x.
[self addAssetsGroupAlbumWithName:albumName
resultBlock:addPhotoToLibraryBlock
failureBlock:failure];
}
from alassetslibrary-customphotoalbum.
Seems u cannot get the PHPhotoLibrary
class, can confirm it?
Class PHPhotoLibrary_class = NSClassFromString(@"PHPhotoLibrary");
if (PHPhotoLibrary_class) {
...
} else {
// code that always creates an album on iOS 7.x.x but fails
// in certain situations such as if album has been deleted
// previously on iOS 8.x.
[self addAssetsGroupAlbumWithName:albumName
resultBlock:addPhotoToLibraryBlock
failureBlock:failure];
}
Wait, u're testing the demo project? Seems the demo project has not imported the framework yet.
from alassetslibrary-customphotoalbum.
The demo project work fine. In my project in a last version worked fine but now don´t work.
This in your class
#import "ALAssetsLibrary+CustomPhotoAlbum.h"
#import <Photos/PHPhotoLibrary.h>
This in my class
-(void)photo{
UIImage *image = [ImageGenerator imageWithView:self.view];
NSDateFormatter * dateFormatter = [NSDateFormatter new];
[dateFormatter setDateFormat:@"YYYYMMDD"];
_namePhoto = [dateFormatter stringFromDate:[NSDate date]];
[ImageGenerator saveImage:image name:_namePhoto];
[self.library saveImage:image toAlbum:self.sessionData.merchant.merchantName completion:^(NSURL *assetURL, NSError *error) {
if (error)
DLog(@"ERROR SAVE ALBUM");
[self performSelectorOnMainThread:@selector(endPhoto) withObject:nil waitUntilDone:YES];
} failure:^(NSError *error) {
DLog(@"FAILURE SAVE ALBUM");
[self performSelectorOnMainThread:@selector(endPhoto) withObject:nil waitUntilDone:YES];
}];
}
Allways return "failure save album" and not recognize PHPhotoLibrary...
This Image is saved in the camera roll
from alassetslibrary-customphotoalbum.
Step 1
Generally, the failure
block will be invoked if user denied ur app to access to the assets library. Plz make sure ur app is allowed to access the photos app in Settings.app after u upgraded ur system version.
Step 2
Seems u want to change the name for photo, then save it to album. Plz comment out the code snippet below to avoid other factors before do testing first.
NSDateFormatter * dateFormatter = [NSDateFormatter new];
[dateFormatter setDateFormat:@"YYYYMMDD"];
_namePhoto = [dateFormatter stringFromDate:[NSDate date]];
[ImageGenerator saveImage:image name:_namePhoto];
Step 3
Check the value of image
& self.sessionData.merchant.merchantName
, make sure they're the one u want.
from alassetslibrary-customphotoalbum.
In the Navigation project appear the Photos.framework but not in the target. I add the framework again and it works!!! Really thanks! When the xcode updated, it removed my framework...
Thanks again!
from alassetslibrary-customphotoalbum.
Haha, cool!
from alassetslibrary-customphotoalbum.
Related Issues (20)
- HI~Sir, I have a problem HOT 4
- I have gone through its very good wrapper for ALAsset library is there a way to load video like loading images from albumb HOT 1
- *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ALAssetsLibrary saveImage:toAlbum:completion:failure:]: unrecognized selector sent to instance HOT 4
- Can't create album with same name as a deleted one HOT 4
- Add Photos.framework as one more Dependancy for iOS 8 HOT 3
- Saving bulk images fails! HOT 2
- Multithreading violation in iOS 8.3+ HOT 8
- Failure Block isn't working properly. HOT 1
- When custom album was deleted by somebody through system PhotoApp, execute -saveImage:toAlbum:completion:failure:will throw error HOT 5
- ios8.4 sometimes fail when addAssetURL to album HOT 15
- Option to check if image exists in the newly created folder in gallery? HOT 4
- Image getting saved to Camera roll as well. HOT 1
- Method to remove image from Camera Roll. HOT 1
- iOS9 cannot create new album group HOT 6
- iOS9 saving bug. HOT 11
- Not saving images in iOS 10 HOT 4
- Thanks! HOT 1
- ALAssetsGroup failed to add asset: null on iOS11 HOT 10
- not working iOS 11.3 , and 11.4 ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alassetslibrary-customphotoalbum.