ios8

PHAsset get original file name

醉酒当歌 提交于 2019-12-20 09:18:46
问题 I wonder if there any way to get the original file name using PHAsset? I use the following code to extract the file info. [[PHImageManager defaultManager] requestImageDataForAsset:asset options:requestOption resultHandler:^(NSData *imageData, NSString *dataUTI, UIImageOrientation orientation, NSDictionary *info) { entity.fileUrl = [info objectForKey:@"PHImageFileURLKey"]; entity.filename = [[NSFileManager defaultManager] displayNameAtPath:[ entity.fileUrl path]]; }]; However, It doesn't

How can I access specific iOS app's directory with Objective C?

非 Y 不嫁゛ 提交于 2019-12-20 09:14:09
问题 I'm trying to write an app for jailbroken iOS devices that can load files from another app. But appstore apps are stored in folders with seemingly random characters that vary per device. How can I figure out the directory for X app on the device? On iOS 8, achieving this seems harder due to the way the app filesystem is structured. 回答1: iOS 7 and below AppStore apps are installed in /var/mobile/Applications inside directory with random name. App's directories (documents, library etc) and *

Whats the programmatic opposite of showViewController:sender:

╄→尐↘猪︶ㄣ 提交于 2019-12-20 09:10:04
问题 I'm writing an iOS 8 only app and I'm using the new adaptive presentations using a combination of the "Show" and the "Show Detail" segue and the showViewController:sender: and showDetailViewController:sender: methods. My question is what is the programatic way to go back after calling showViewController:sender: ? The way the view controller is shown depends on its parent context. E.g. in a UINavigationController showViewController:sender: pushes a new controller onto the navigation stack but

AutoLayout row height miscalculating for NSAttributedString

泄露秘密 提交于 2019-12-20 09:07:11
问题 My app pulls HTML from an API, converts it into a NSAttributedString (in order to allow for tappable links) and writes it to a row in an AutoLayout table. Trouble is, any time I invoke this type of cell, the height is miscalculated and the content is cut off. I have tried different implementations of row height calculations, none of which work correctly. How can I accurately, and dynamically, calculate the height of one of these rows, while still maintaining the ability to tap HTML links?

AutoLayout row height miscalculating for NSAttributedString

此生再无相见时 提交于 2019-12-20 09:05:19
问题 My app pulls HTML from an API, converts it into a NSAttributedString (in order to allow for tappable links) and writes it to a row in an AutoLayout table. Trouble is, any time I invoke this type of cell, the height is miscalculated and the content is cut off. I have tried different implementations of row height calculations, none of which work correctly. How can I accurately, and dynamically, calculate the height of one of these rows, while still maintaining the ability to tap HTML links?

Hide back button in navigation bar with hidesBackButton in Swift

此生再无相见时 提交于 2019-12-20 08:57:18
问题 I want to hide the back button when transitioning from one view to another. I read the questions regarding this problem and every answer was "use hidesBackButton ". The problem with this is: when I put it in viewDidLoad/viewWillAppear the back button arrow hides but the string "Back" doesn't. when I put it in viewDidAppear the back button disappears but it visible to the user How can I fix this? Edit: Here is how you can replicate this problem(or bug?) Make a new Tabbed application with Swift

iOS 8 today widget stops working after a while

十年热恋 提交于 2019-12-20 08:39:50
问题 I've made a today widget for the german ice hockey league DEL. I'm loading the next games from our server an show them in a tableView. The loading process is started in the proposed method "widgetPerformUpdateWithCompletionHandler". Initially i'm loading some cached data in "viewWillAppear". Everything works great so far! But after a while (one day) the widget stops working. When I open the notification center the widget appears normal, but it is never updated again. I have to remove the

Why requestWhenInUseAuthorization doesn't prompt the user for access to the location?

别等时光非礼了梦想. 提交于 2019-12-20 07:59:11
问题 In my viewDidLoad method I have locationManager = [[CLLocationManager alloc]init]; // initializing locationManager locationManager.delegate = self; // we set the delegate of locationManager to self. locationManager.desiredAccuracy = kCLLocationAccuracyBest; [locationManager startUpdatingLocation]; if([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { [locationManager requestWhenInUseAuthorization]; } And the request is called, but the user is not prompted? Why? 回答1: You probably

does not have a member 'instantiateWithOwner'

坚强是说给别人听的谎言 提交于 2019-12-20 06:49:06
问题 I'm trying to make a popup like I described in my previous question. I actually got an answer, but now I have a new problem. I can make the view appear if I don't make the instantiateWithOwner , but it is not responding to anything (just frozen). In short, I have set up a 'popup.xib' file, which is just a view with a button and a label. My code below should make it appear and disappear with button clicks. I have read the documentation that the instantiateWithOwner does all the magic of

UIImageView Position Resetting during label text update

吃可爱长大的小学妹 提交于 2019-12-20 06:29:49
问题 Really weird issue going on here. Using XCode6 with iOS8 I have a simple UIImageView, which moves across the screen when I click. No problem- works great. I Just have a simple method to update specific labels...based on an int called StrikesLeft. Here is my updateLabels method: -(void)displayLabels{ //update strikes label strikesLeftDisplay = [NSString stringWithFormat: @"%d", strikesLeft]; lblStrikes.text=strikesLeftDisplay; } Here is the weird issue though: If I don't actually update the