B-Sides / ELCImagePickerController

A clone of the UIImagePickerController using the Assets Library Framework allowing for multiple asset selection
http://www.icodeblog.com
1.65k stars 469 forks source link

Crash in [ELCAssetCell layoutSubviews] #15

Closed AzeemKhan123 closed 11 years ago

AzeemKhan123 commented 13 years ago

Hello All,

Overall picker works great.But just occasionally it crashes with the following error.I would really appreciate if some one can help me resolve this issue.

Azeem

Error: 2011-11-02 16:39:18.261 distribution[606:701f] -[NSCFType setFrame:]: unrecognized selector sent to instance 0x1e0940 2011-11-02 16:39:18.306 distribution[606:701f] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFType setFrame:]: unrecognized selector sent to instance 0x1e0940' *\ Call stack at first throw: ( 0 CoreFoundation 0x3759dc7b exceptionPreprocess + 114 1 libobjc.A.dylib 0x32d9bee8 objc_exception_throw + 40 2 CoreFoundation 0x3759f3e3 -[NSObject(NSObject) doesNotRecognizeSelector:] + 98 3 CoreFoundation 0x37544467 __forwarding** + 506 4 CoreFoundation 0x37544220 _CF_forwarding_prep_0 + 48 5 distribution 0x0000dd0b -[ELCAssetCell layoutSubviews] + 250

nzrsky commented 12 years ago

I have same trouble (

patricksan commented 12 years ago

Related to the same line I get SIGSEGV because elcAsset is already deallocated.


    CGRect frame = CGRectMake(4, 2, 75, 75);

    for(ELCAsset *elcAsset in self.rowAssets) {

        [elcAsset setFrame:frame];
        [elcAsset addGestureRecognizer:[[[UITapGestureRecognizer alloc] initWithTarget:elcAsset action:@selector(toggleSelection)] autorelease]];
        [self addSubview:elcAsset];

        frame.origin.x = frame.origin.x + frame.size.width + 4;
    }
jvanmetre commented 11 years ago

These crashes should be fixed in versions greater than 2ac497ef0b2e1d18a9d842e228dcbade5a5e9b82 (0.0.4)