ios - 将 Aviary 添加为 subview 时出现崩溃问题

标签 ios aviary

在我的一个项目中,我集成了 aviary sdk 。当我使用 presentmodalViewcontroller 时,它正在工作。但是,当我使用 addsubview 方法时,当我单击 Editorcontroller 中的任何按钮时,它都会崩溃。

enter image description here

AFPhotoEditorController *featherController = [[[AFPhotoEditorController alloc] initWithImage:image] autorelease];
[featherController setDelegate:self];
[featherController.view setBackgroundColor:[UIColor blackColor]];
featherController.view.frame = CGRectMake(0, 0, 512, 748);
[self.view addSubview:featherController.view];
//[self presentModalViewController:featherController animated:YES];

如果我不清楚,请告诉我。提前致谢。

最佳答案

Import AFPhotoEditorController.h in AppDelegate.

Set property to object of AFPhotoEditorController in AppDelegate.h
@property (nonatomic,strong) AFPhotoEditorController *featherController;

Then Declare two methods in AppDelegate.h
-(void)fn_showAFPhotoEditorController;
-(void)fn_removeAFPhotoEditorController;

And synthesize it in AppDelegate.m

@synthesize featherController=_featherController;



-(void)fn_showAFPhotoEditorController{
    AFPhotoEditorController * obj1 =[[AFPhotoEditorController alloc]init];
    [self setfeatherController:obj1];

    [self.window addSubview:[_featherController view]];
    [self setNewViewToLandscape:[_featherController view]];

}
-(void)fn_removeAFPhotoEditorController{
  [_featherController.view removeFromSuperview];

    _featherController=nil; 
}


After that create an instance of AppDelegate wherever you want and just give a call to show view and remove it.

AppDelegate *obj=(AppDelegate *)[[UIApplication sharedApplication] delegate];
[obj fn_showAFPhotoEditorController];////To Show view

[obj fn_removeAFPhotoEditorController];////To Remove it.

关于ios - 将 Aviary 添加为 subview 时出现崩溃问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18051623/

相关文章:

ios - dyld : Library not loaded: @rpath/MicroBlink. 框架/MicroBlink

ios - UIScrollView 高度和宽度

ios - 从 Firebase 数据库 Swift 3 中删除子数据

android - 如何更改 Aviary for Android 给出的裁剪效果的顺序

android - 如何制作画廊?

android - Aviary SDK for Image Editing issue with setNavigationIcon of toolbar

ios - 适用于 iOS 的 Aviary SDK : Present view controller on top of AFPhotoEditorController does not work well

ios - MKStoreKit 错误

java - 您可以将 Oracle ADF 与 IntelliJ Idea 结合使用吗?

ios - 生成文件时出错