iphone - UIScrollView/UITableView crashes when resizing frame -
My app is a paged scrollview with a tableView in each page. At the bottom of the screen I placed an ad banner, which should be hidden because the ads are unavailable and then load when they load. This banner is placed below the scroll view and the user is not affected by scrolling left or right above the top or bottom of the table. So when I resize the scrollView with something like this: This last line is causing me problems Sometimes everything works just fine and it completely changes the scrollview and all its contents, on the other hand, this console Accidents with this: Why is this happening, and why only sometimes? More to talk, how can I reliably change the size of my scrollview?
NSInteger offset = -50; If (self.bannerIsVisible) offset = 50; CGRect frame = scrollView.frame; Frame.ize.height + = offset; ScrollView.contentSize = CGSizeMake (frame.ize.width * pages, frame.size.height); ScrollView.frame = frame;
2010-07-27 10: 25: 31.779 MyApp [8026: 207] - [__ NSArrayM tableView: cellForRowAtIndexPath:]: Non-recognized selector sent for example 0x736eb20 2010-07-27 10: 25: 31.781 MyApp [8026: 207] *** Exempt exceptions' NSInvalidArgumentException ', due to reason the app ended:' - [__ NSArrayM tableView: cel LForRowAtIndexPath:]: Unrecognized selector example sent to 0x736eb20 '** ** Call stack in first throw: (0 CoreFoundation 0x026cb919 __exceptionPreprocess + 185 1 libobjc.A.dylib 0x028195de objc_exception_throw + 47 2 CoreFoundation 0x026cd42b - [NSObject] doesNotRecognizeSelector :] 187 3 CoreFoundation 0x0263d116 ___forwarding___ + 966 4 CoreFoundation 0x0263ccd2 _kf_forwarding_prep_0 + 50 5 UIKit 0x003a3a3f - [Uitblaviav (Uitblaviavintrnl) _kreateprepredkellforgloblrov: Vithindekspat:] + 61 9 6 UIKit 0x00399ad2 - [Uitblaviav (Uitblaviavintrnl) _kreateprepredkellforgloblrov:] + 75 7 UIKit 0x003ae40c - [UITableView (_UITableViewPrivate) _updateVisibleCellsNow:] 1561 8 UIKit 0x003a60d7 - [UITableView (_UITableViewPrivate) _setNeedsVisibleCellsUpdate: withFrames: 372 9 UIKit 0x003a37cd - [UITableView setFrame:] + 266 10 UiKet 0x00367ae8 - [UIView (Oldspwavrwug with resize geometry):] + 385 11 UIKit 0x0036ba2b - [UIView (geometry) Resize Suviai the Sathondiyl Size:] + 273 12 Uaiket 0x00367f79 - [UIView Setfrem (geometry)] + 497 13 Uaikit 0x0038085f - [UIScrollView setFrame:] 617 14 MyApp 0x0000a678 - [MyViewController toggleBanner] 893
That looks very much like the object was released data source of your table view and was therefore representative method had went sent to a different object. This is a memory management problem, so you can see what it catches the problem, you can try to play with zombies device your app.
Comments
Post a Comment