ios6

Avoid animation of UICollectionView after reloadItemsAtIndexPaths

痞子三分冷 提交于 2019-12-17 15:18:33
问题 UICollectionView animate items after reloadItemsAtIndexPaths is called (fade animation). Is there a way to avoid this animation? iOS 6 回答1: You could also try this: UICollectionView *collectionView; ... [UIView setAnimationsEnabled:NO]; [collectionView performBatchUpdates:^{ [collectionView reloadItemsAtIndexPaths:indexPaths]; } completion:^(BOOL finished) { [UIView setAnimationsEnabled:YES]; }]; Edit: I have also found that if you wrap performBatchUpdates in a UIView animation block, the

How to get IMEI on iPhone 5

江枫思渺然 提交于 2019-12-17 10:57:17
问题 I'm develop application for jailbroken iOS devices. I use https://github.com/erica/uidevice-extension/blob/master/UIDevice-IOKitExtensions.m to get IMEI, but on iPhone 5 this solution does not work(return empty string). Is there any way to get IMEI on iPhone 5(iOS 6.1.2)? 回答1: There are several ways to get IMEI on newer devices 1) Private ManagedConfiguration.framework CFStringRef MCCTIMEI() 2) CoreTelephony.framework struct CTResult { int flag; int a; }; extern CFStringRef

How to execute some code after a segue is done?

a 夏天 提交于 2019-12-17 10:56:29
问题 Is it possible in iOS 6 to know when a UIStoryboardSegue has finished its transition? Like when i add a UIStoryboardSegue from UIButton to push another UIViewController on the navigationcontroler, i want to to something right after the push-transition is finished. 回答1: You can use the UINavigationControllerDelegate protocol and then define: – navigationController:didShowViewController:animated: 回答2: In case you don't want to use the viewDidAppear: method, you could create a custom segue. In

Change UIImageView size to match image with AutoLayout

蓝咒 提交于 2019-12-17 10:31:28
问题 I want to change my UIImageView height/width to match the image i choose from photo album and i found a snippet on here that does that. -(CGRect)frameForImage:(UIImage *)imgs inImageViewAspectFit:(UIImageView *)imagev { float imageRatio = imgs.size.width / imgs.size.height; float viewRatio = imagev.frame.size.width / imagev.frame.size.height; if(imageRatio < viewRatio) { float scale = imagev.frame.size.height / imgs.size.height; float width = scale * imgs.size.width; float topLeftX = (imagev

Change UIImageView size to match image with AutoLayout

痞子三分冷 提交于 2019-12-17 10:31:20
问题 I want to change my UIImageView height/width to match the image i choose from photo album and i found a snippet on here that does that. -(CGRect)frameForImage:(UIImage *)imgs inImageViewAspectFit:(UIImageView *)imagev { float imageRatio = imgs.size.width / imgs.size.height; float viewRatio = imagev.frame.size.width / imagev.frame.size.height; if(imageRatio < viewRatio) { float scale = imagev.frame.size.height / imgs.size.height; float width = scale * imgs.size.width; float topLeftX = (imagev

contentView not indenting in iOS 6 UITableViewCell prototype cell

谁都会走 提交于 2019-12-17 10:14:40
问题 I am configuring a custom UITableViewCell using a prototype cell in a Storyboard. However, all the UILabel s (and other UI elements) do not seem to be added to the cell's contentView , instead being added to the UITableViewCell view directly. This creates issues when the cell is put into editing mode, as the content is not automatically shifted/indented (which it would do, if they were inside the contentView ). Is there any way to add the UI elements to the contentView when laying out the

How programmatically restart an iPhone app in iOS

五迷三道 提交于 2019-12-17 10:06:16
问题 How programmatically restart an iPhone app in iOS? I find this way http://writeitstudios.com/david/?p=54 But may be something simple. 回答1: The only way I know to do this is not ideal, but it works. First, your app has to opt out of background execution (multitasking) The app has to quit when exited, not run as a background task. This is done with the plist key UIApplicationExitsOnSuspend. Second, your app needs to register a custom URL scheme that can be used to launch the app. Third, you

The advertisingIdentifier and identifierForVendor return “00000000-0000-0000-0000-000000000000”

柔情痞子 提交于 2019-12-17 09:35:54
问题 I've implemented this methods to get advertisingIdentifier and identifierForVendor : - (NSString *) advertisingIdentifier { if (!NSClassFromString(@"ASIdentifierManager")) { return [OpenUDID value]; } return [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]; } - (NSString *) identifierForVendor { if ([[UIDevice currentDevice] respondsToSelector:@selector(identifierForVendor)]) { return [[[UIDevice currentDevice] identifierForVendor] UUIDString]; } return @""; } - (BOOL

UIRefreshControl at the bottom of the UITableView iOS6?

强颜欢笑 提交于 2019-12-17 09:32:50
问题 Is it possibile add UIRefreshControl at the bottom of the UITableView ? I would use it to load more data. Please, Any suggest? 回答1: I believe there won't be any simple solution to this problem. May be someone could write a separate library to implement this behaviour plus it will cause more complications once you cache data in tableview. But let us break down the problem and that might help you in achieving what you want. I have used the following code to add more rows in the app: - (void

nib but didn't get a UITableView

旧巷老猫 提交于 2019-12-17 07:27:23
问题 My application works for iOS 5.1 but for iOS 6 simulator I get the following error. Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "MainListViewController" nib but didn't get a UITableView.' I am subclassing UITableViewController and I don't want to change it. The tableview is created programmatically, there is a dummy MainListViewController.xib to load from Mainwindow.xib Tab Bar Controller. I also tried to