ios6

How to reload only data section of UICollectionView?

烈酒焚心 提交于 2019-12-03 08:35:15
I'm trying to reload only data section, not header or footer (supplementary view), of UICollectionView. When I use reloadData method, header and footer section also reloads, so that's what I want. I found the method reloadSections: , but I don't know why it doesn't work. Because my collection view only contains one section, so I tried using the method like this: [collectionViewController.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]]; But it makes runtime error when the method is called. The content of error is: 'NSInvalidArgumentException', reason: '-

Is there a way to automatically scroll to the bottom of a UICollectionView

别来无恙 提交于 2019-12-03 08:31:48
So I'm currently working on a project that has a button that adds cells to a UICollectionView and then needs to automatically scroll to the last cell (i.e. the bottom of the UICollectionView). I've found the method scrollToItemAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UICollectionViewScrollPosition)scrollPosition animated:(BOOL)animated But now I'm getting stuck at trying to find the indexPath of the last object in the CollectionView. The problem seems to lie in that I've been trying to think of the cells in the UICollectionView as an array (can't enumerate through them, doesn't

How do I programmatically slide the UITableView down to reveal the underlying UIRefreshControl

时间秒杀一切 提交于 2019-12-03 08:29:32
问题 How can I reveal the UIRefreshControl when I update the table programmatically? Using [self.refreshControl beginRefreshing] make the spinner animate but does not reveal it. 回答1: You'll have to manually change the contentOffset of your UITableView yourself. Be sure to account for the contentInset.top . It should be something as simple as: CGPoint newOffset = CGPointMake(0, -[myTableView contentInset].top); [myTableView setContentOffset:newOffset animated:YES]; 回答2: This will do the trick -

UIPageViewController: get the currentPage

女生的网名这么多〃 提交于 2019-12-03 08:26:19
问题 I have been struggling with this issue for the last few days and after all this juggling I have figured out that all I need is the current Index from the datasource method to update with current visible page number I have this UIPageViewController datasource method and I need to use the current index to get the current visible page for delegate method previousViewControllers transitionCompleted:(BOOL)completed - (UIViewController *)pageViewController:(UIPageViewController *)pageViewController

Cannot generate Apple Passbook signature

空扰寡人 提交于 2019-12-03 08:20:18
I am writing a shell script to automatically generate an Apple Passbook signature file from manifest.json using p12 certificate. Here is what I do: openssl pkcs12 -passin pass:"mypass" -in "mycert.p12" -clcerts -nokeys -out certificate.pem openssl pkcs12 -passin pass:"mypass" -in "mycert.p12" -nocerts -out key.pem openssl smime -passin pass:"mypass" -binary -sign -signer certificate.pem -inkey key.pem -in manifest.json -out signature -outform DER The first two functions work fine. At least both certificate.pem and key.pem are created. The signature file is also created, but for some reason it

Link to App Store app developer page with iOS 6?

时光怂恿深爱的人放手 提交于 2019-12-03 07:42:31
问题 Is there a way, in iOS 6, to link from an app to a specific developer's page on the App Store app? By that I mean a list showing all the apps by the developer. There are various ways to link to the store (I am using the Appmosys as the example here) that produce various results: http://itunes.apple.com/us/artist/appmosys/id331687329 - The link copied from desktop iTunes, opens up the iTunes app on an iOS 6 device, with the developer's page. If you tap on one of their apps, it goes to that app

ARC App Crashes when accessing @property form ARC static lib

谁都会走 提交于 2019-12-03 07:24:02
I have a ARC ( automatic-reference-counting ) app that builds a static library (also ARC). The app will launch fine but when the an action is performed that reads or writes to a @property in the static library the app will crash with this error: dyld: lazy symbol binding failed: Symbol not found: _objc_setProperty_nonatomic Referenced from: /var/mobile/Applications/0E7ADBB4-FFE5-4CEB-B418-8A35A92E99D4/MyApp.app/MyApp Expected in: /usr/lib/libobjc.A.dylib dyld: Symbol not found: _objc_setProperty_nonatomic Referenced from: /var/mobile/Applications/0E7ADBB4-FFE5-4CEB-B418-8A35A92E99D4/MyApp.app

Customizing subtitles with AVPlayer

风流意气都作罢 提交于 2019-12-03 07:15:13
I was able to display a subtitle track with AVPlayer on iOS 6, but I am not able to customize it. It just shows the same style (a small font size, in white). Here's how I select the subtitle: AVMediaSelectionGroup *subtitle = [asset mediaSelectionGroupForMediaCharacteristic: AVMediaCharacteristicLegible]; [self.videoPlayer.currentItem selectMediaOption:subtitle.options[0] inMediaSelectionGroup: subtitle]; And how I'm trying to customize the subtitle: AVTextStyleRule *rule = [[AVTextStyleRule alloc] initWithTextMarkupAttributes:@{ (id)kCMTextMarkupAttribute_ForegroundColorARGB : @[ @1, @1, @0,

UIWebView scrolling down on input focus iOS 6 only

柔情痞子 提交于 2019-12-03 07:15:12
问题 I'm loading a UIWebView in a modal. The web page has some inputs that work exactly as intended in iOS 5. However in iOS 6, anytime an input gets focus, the keyboard is doing it's automatic 'centering' of the form even though the inputs have plenty of room to be shown above the keyboard. Since some of the inputs are at the top of the page, this forces them out of view so the user cannot see what they are typing. Scrolling back up to see the inputs causes the keyboard to stop working until

What works in viewDidUnload should be moved to didReceiveMemoryWarning?

南笙酒味 提交于 2019-12-03 07:12:31
In new iOS 6, viewDidUnload is deprecated and we have been instructed to use didReceiveMemoryWarning instead, to manage objects in UIViewController instances and subclasses. Is it equally effective to assign nils to UIView kinds inside didReceiveMemoryWarning like the way it has been done inside viewDidUnload ? I am asking this because these two methods seems to be working differently. It seems like didReceiveMemoryWarning doesn't guarantee viewDidLoad to be called again to re-instantiate any necessary UIViews. I suspect with iOS 6, memory management is done without requiring to manually