29,027
社区成员
发帖
与我相关
我的任务
分享
ALAssetsLibrary* alLibrary = [[ALAssetsLibrary alloc] init];
NSURL *urlstr = [NSURL URLWithString:@"http://......"];
[alLibrary assetForURL:urlstr resultBlock:^(ALAsset *asset) {
} failureBlock:^(NSError *error) {
}];
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation
{
if ([sourceApplication isEqualToString:@"com.yourapp.AppName"]) //com.yourapp.AppName为调用者应用的bundle id
{
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
/*这两句和这个里面一样
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil] autorelease];
} else {
self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil] autorelease];
}
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
*/
}
return YES;
}