ios6

UIScrollView in iOS 6

南楼画角 提交于 2019-12-09 04:42:39
问题 Recently i've downloaded Xcode 4.5(iOS 6),but when tried to continue one of my projects i noticed that the UIScrollView isn't working properly,let me explain more clearly: I've created the UIScrollView and added the initialized it using the following code: -(void)viewDidLoad{ [mainScrollView setScrollEnabled:YES]; mainScrollView.contentSize = CGSizeMake(480, 0); [super viewDidLoad]; } After i opened my XIB and linked the mainScrollView to a UIScrollView,after i added some UIButton's to the

UIActivityViewController with HTML

徘徊边缘 提交于 2019-12-09 04:16:51
问题 When I pass a string containing HTML content as an array element to the UIActivityViewController initWithActivityItems method it doesn't present it as HTML in the selected 'share' controller, but instead presents the HTML source (i.e. the markup rather than interpreting it). And while I can understand why it would do this for share targets that don't support html content, it won't interpret it for things like email either, which do (previously this would be done by setting the isHTML property

Add more UICollectionViewCell to an existing UICollectionView

此生再无相见时 提交于 2019-12-09 02:49:57
问题 I'm trying to add some more cells to an existing UICollectionView , which is already filled with some cells. I tried to use the CollectionView reloadData but it seems to reload the entire collectionView and I just wanted to add more cells. Can anybody help me? 回答1: The UICollectionView class has methods to add/remove items. E.g., to insert an item at some index (in section 0 ), modify your model accordingly and then do: int indexPath = [NSIndexPath indexPathForItem:index]; NSArray *indexPaths

Deprecated code in iOS 6 fallback to iOS 5

橙三吉。 提交于 2019-12-09 01:57:48
问题 I have this custom back button: - (IBAction)backToMenu:(id)sender { [self.presentingViewController dismissModalViewControllerAnimated:YES]; } Testing my app in the iOS 6 simulator says dismissModalViewControllerAnimated is deprecated, and I must use dismissViewControllerAnimated instead, so, how I can use the iOS 6 code and fallback to iOS 5 I have tried this: if([self respondsToSelector:@selector(presentingViewController:animated:completion:)]) [self.presentingViewController

My UIScrollView doesn't work with auto-layout in ios6

感情迁移 提交于 2019-12-09 01:52:34
问题 I have put an UIScrollView in my UIViewController into my storyboard. When I use this code: - (void)viewDidLoad { [super viewDidLoad]; [_scrollview setContentSize:CGSizeMake(_scrollview.bounds.size.width*2, _scrollview.bounds.size.height)]; [_scrollview setPagingEnabled:YES]; CGRect rect = _scrollview.bounds; UIView* view = [[UIView alloc]initWithFrame:rect]; [view setBackgroundColor:[UIColor redColor]]; [_scrollview addSubview:view]; rect = CGRectOffset(rect, _scrollview.bounds.size.width, 0

How to play multiple audio files in sequence by loop in AVAudioPlayer?

半城伤御伤魂 提交于 2019-12-09 01:40:28
问题 I want to play multiple files by using loop. I written code below.. Please help me.!!.. soundList = [[NSArray alloc] initWithObjects:@"mySong1.mp3",@"mySong2.mp3",@"mySong3.mp3",@"mySong4.mp3",@"mySong5.mp3",@"mySong6.mp3",@"mySong7.mp3",@"mySong8.mp3",@"mySong9.mp3", nil]; for (i=0; i<=([soundList count] - 1); ) { while(i<[soundList count]){ NSLog(@"File is : %@",[soundList objectAtIndex:i]); mediaPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[[NSURL alloc] initFileURLWithPath:[

Taking Screenshots from iOS app - emulating Display recorder (query on the internals)

纵然是瞬间 提交于 2019-12-08 22:22:31
问题 I need to create an iOS app which can take screenshots of other apps, videos etc. as a part of an experiment. I am open to using Private API's since I won't be publishing the app to the app store. I could successfully use the method GetUIScreenImage() to take snapshots of the current screen (app screen). However, due to sandbox restrictions I am not able to take screenshots while in the background. I get the error - "Cannot call CreateUIScreenImage() while the app is in background". I

Revert Xcode 4.5 new XIB files to iOS<6

血红的双手。 提交于 2019-12-08 20:16:30
问题 i've installed Xcode 4.5 with iOS6 SDK and others old SDKs (from 4.3 to 6.0) for testing purpose. Beautiful, but there is a BIG problem! A new XIB file is generated for iOS6 compliant! This is a problem, because my app need to run on older devices , not only 6.0+! When i load the new view (ios6) in a 5.1 device, it silently crash with this error: 2012-09-24 22:00:17.090 App[14524:11f03] * Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not

Multiple MODAL VIEW controller change base modal to FULL SCREEN after ROTATION

心不动则不痛 提交于 2019-12-08 19:15:45
问题 This has been troubling me for quite a while, and I have done so much research on this, but could't find an answer. My first time posting a question here, please correct/forgive me if I make a mistake. Environment: iPad, iOS 6.0 Problem: Base modal view change to full screen after rotation. Description: I have a full screen application running currently showing a modal view controller. From the showing modal view, I display another modal view by doing: vc.modalPresentationStyle =

Using Auto Layout to change spaces equally on resizing

岁酱吖の 提交于 2019-12-08 19:08:43
问题 If I have a view in my app with 3 subviews (as an example) with the following spacing between them: TOP - 40 points - SUBVIEW 1 - 60 points - SUBVIEW 2 - 80 points - SUBVIEW 3 - 80 points - BOTTOM I understand how I can use auto layout to ensure each of my subviews keeps it's height and width, and I can get everything to be aligned on either a 3.5 OR 4 inch iPhone screen. But I can't work out what kind of constraint I need to make it so that if it were aligned for a 3.5" screen, and then went