ios6

ios 6 orientation methods

天涯浪子 提交于 2019-12-02 23:15:09
问题 the orientation methods have changed in iOS 6. my whole app in portrait mode got to many view controllers (not tab bar view controllers) i just want to rotate one of my view controller to landscape mode (it actually displays a webView) when i rotate the device.the below method was working in xcode 4.4 but, it's not in Xcode.4.5 - (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait ||

iOS 6 appearance when contained in multiple classes

牧云@^-^@ 提交于 2019-12-02 22:38:46
I’m using the appearanceWhenContainedIn method on certain UI elements that I want to customise in my iOS 6 app. The problem I found is that none of my customisations are applied if I try to provide more than one container class, like so: // Works neither for toolbar nor navbar items [UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], [UIToolbar class], nil] // Works fine (but only for navbar items, obviously) [UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], nil] The official docs say that the parameter for this method can be a nil-terminated list of multiple

How to find the substring between two string? [closed]

拈花ヽ惹草 提交于 2019-12-02 22:37:22
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center . I have a string "hi how are... you" I want to find the Sub-string after how and before you.. How to do this in objective c? Find the range of the two strings and return the substring in between: NSString *s = @"hi how are... you"; NSRange r1 = [s rangeOfString:@"how"];

UINavigationController State Restoration (without Storyboards)

蹲街弑〆低调 提交于 2019-12-02 22:34:06
I've been toying around with state restoration. In the code below, the scroll position of the UITableViewController gets restored, however, if I were to tap through into the detail view (pushing an instance of MyViewController onto the navigation stack), when the app restarts, it always returns to the first view controller in the navigation stack (i.e. MyTableViewController). Would somebody be able to help me restore to the correct view controller (i.e. MyOtherViewController)? AppDelegate.m - (BOOL)launchWithOptions:(NSDictionary *)launchOptions { static dispatch_once_t onceToken; dispatch

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

三世轮回 提交于 2019-12-02 22:13:36
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. 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]; Peter Lapisu This will do the trick - (void)beginRefreshingTableView { [self.refreshControl beginRefreshing]; // check if contentOffset is

Top-aligning text of different sizes within a UILabel

丶灬走出姿态 提交于 2019-12-02 21:24:20
How to top-align text of different sizes within a UILabel? An example is top-aligning smaller-sized cent amount with larger-sized dollar amount in price banners. UILabel in iOS6 supports NSAttributedString which allows me to have text of different sizes in the same UILabel. However it doesn't seem to have an attribute for top-aligning text. What are the options to implement this? It seems to me that providing a custom drawing logic to do top-alignment based on a custom attributed string key might be best but I have no idea how to go about it. I was able to achieve your desired result using a

Link to App Store app developer page with iOS 6?

人走茶凉 提交于 2019-12-02 21:09:52
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 on the App Store app. http://itunes.com/apps/appmosys - Opens the iTunes app (via Safari) but presents

UIActivityViewController with HTML

不羁岁月 提交于 2019-12-02 20:45:34
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 to YES on the MFMailComposeController ). Should I waste my time creating a UIActivityItemProvider that

UIApplication's -canOpenURL: -openURL: return misleading result

只愿长相守 提交于 2019-12-02 20:45:09
Since iOS6, I can't tell whether the application can launch Safari or not. If Safari is restricted on the device (Settings>General>Restrictions), nothing happens when trying to open a URL, and there's no indication of what went wrong: NSURL *url = [NSURL URLWithString:@"http://www.google.com"]; [[UIApplication sharedApplication] canOpenURL:url]; // Returns YES [[UIApplication sharedApplication] openURL:url]; // Returns YES However, Safari does not launch, and the user is left wondering why my buttons are "broken". This seems like a bug to me so I filed a radar #12449905. Is there another way

Group table view background color is deprecated in ios 6.0 [duplicate]

六月ゝ 毕业季﹏ 提交于 2019-12-02 20:43:50
This question already has answers here : is groupTableViewBackgroundColor deprecated on iOS 6? (9 answers) Possible Duplicate: is groupTableViewBackgroundColor deprecated on iOS 6? I am getting this warning on my storyboard in iOS 6. I would hover to see the replacement method, but since I'm viewing the storyboard it shows me nothing. How can I easily set the background color? Seems like I should be able to do this from the Interface Builder. Mhdali Open your storyboard, check all views in the Attributes Inspector and change all views with Grouped Table View background color to any other color