-
Notifications
You must be signed in to change notification settings - Fork 163
Error on iOS7 #23
Comments
What's the problem with the library?
|
It crash the app when running on iOS7. |
I did made i simple sample of the problem: |
The error happens on line: - (void)didMoveToSuperview {
....
[self setTranslatesAutoresizingMaskIntoConstraints:NO];
....
} If you comment, it dont crash, but the view is not centralized. |
Library require auto-layout, anyway I will check what I can do. |
I had added a README file on my sample repository to you see. Please, help me with this :( |
You can not add CarbonSwipeRefresh as subview of tableView. |
#import "ViewController.h"
@interface ViewController ()
{
UITableView *tableView;
}
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"CarbonKit - Error - iOS7";
tableView = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStylePlain];
[self.view addSubview:tableView];
[self enablePullToRefresh];
}
- (void)enablePullToRefresh
{
self.refresh = [[CarbonSwipeRefresh alloc] initWithScrollView:tableView];
[self.refresh setMarginTop:64];
[self.view addSubview:self.refresh];
[self.refresh addTarget:self action:@selector(pullToRefresh:) forControlEvents:UIControlEventValueChanged];
}
- (void)pullToRefresh:(id)sender
{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.refresh endRefreshing];
});
}
@end |
CarbonSwipeRefresh can't be child of tableView. It must be child of tableview parent. You need to add a tableView inside a viewController not directly in UITableViewController #import <UIKit/UIKit.h>
#import <CarbonKit/CarbonKit.h>
@interface ViewController : UIViewController
@property (nonatomic, retain) CarbonSwipeRefresh *refresh;
- (void)enablePullToRefresh;
- (void)pullToRefresh:(id)sender;
@end replace UITableViewController with UIViewController |
Ok, i have made the correction on project. It is working now, but i need put the code if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
{
self.edgesForExtendedLayout = UIRectEdgeNone;
} I need it? |
I closed this issue |
Hi,
I have a problem on iOS7 only with my customers. Im receiving the error that is a bug on iOS7 and it is a common error but i tried without success solve it.
Can you help me?
The text was updated successfully, but these errors were encountered: