小编use*_*837的帖子

调用可选协议方法时崩溃

我使用一些带有一些可选方法的协议.

@protocol PhotoDropDownDelegate <NSObject>

@optional
    - (void)getEditResult:(NSString *)status;
    - (void)getImageForDiagram:(UIImage *)image andImagePath:(NSString *)imagePath;
    - (void)dismissPhotoDropDown;

@end
Run Code Online (Sandbox Code Playgroud)

我把它分配给一个班级

photoDropDownViewController.photoDropDownDelegate = self;
Run Code Online (Sandbox Code Playgroud)

我只使用一种方法

- (void)getImageForDiagram:(UIImage *)image andImagePath:(NSString *)imagePath
{
    // Make a Image on center of screen
    PhotoLayer *photoLayer = [PhotoLayer nodeWithLengthOfShape:300 andHeight:200 andPathToImage:imagePath];
    photoLayer.position = ccp(400, 500);
    photoLayer.nameObject = [self makeNewName_ForShape];    
    photoLayer.isSelected_BottomRightElip = YES;
    photoLayer.isSelected = YES;


    [photoLayer doWhenSelected_Elip_BottomRight];
    [photoLayer show_Elip];

    [list_Shapes addObject:photoLayer];

    [self addChild:photoLayer];
    photoLayer = nil;

    // Set Button Delete
    selected_GerneralShapeLayer = (GerneralShapeLayer *) [list_Shapes lastObject];
    [self updateStatusForButtonDelete];
} …
Run Code Online (Sandbox Code Playgroud)

iphone protocols ios

0
推荐指数
1
解决办法
875
查看次数

标签 统计

ios ×1

iphone ×1

protocols ×1