ios5

How do you save a picture with NSUserDefaults?

你离开我真会死。 提交于 2019-12-24 19:36:11
问题 I have a iPad app that can take a picture and then put it within a image view. How do I go about saving the pic that I have stored in the image view? Here is what I have tried so far: [imageView setImage:[[NSUserDefaults standardUserDefaults] objectForKey:@"storedImageValue6"]]; 回答1: Pretty much you have to convert it to NSData and vice versa. Take a look at this link: Save images in NSUserDefaults? 回答2: Here imageSet is UIImage NSData *imagedata=UIImagePNGRepresentation(imageSet); [

Get title of selected tab in UITabBarController

ⅰ亾dé卋堺 提交于 2019-12-24 17:17:14
问题 I have set the title for all five of my tabs in my AppDelegate file. I would like to access that title in another view within my application. I have the code below to output to the log window the selected index of that selected tab but what I'd really like to get is the title for that tab. I did have a look through the UITabBarController Class Reference and I didn't see anything that would allow me to do this. What I am trying to avoid is some sort of switch or if...else statement where I

Custom image “more” tab in iOS and image colors in more items

被刻印的时光 ゝ 提交于 2019-12-24 17:01:24
问题 Is there any way to set a custom image for the "more" tab in iOS? And on the other side the items images that appears when I click in the more tab appears in black. Is there any way to set this image to be in colors? 回答1: You could try to implement a custom tabBar like this. https://github.com/judges/RXCustomTabBar 来源: https://stackoverflow.com/questions/10131351/custom-image-more-tab-in-ios-and-image-colors-in-more-items

ios - why does my UITableView not get populated with comments

喜欢而已 提交于 2019-12-24 16:58:54
问题 I have a UITableView which is declared like this in my .h file: @interface EnterInviteCodeController : UIViewController @property (weak, nonatomic) IBOutlet UITableView *itemList; @end And then I declare it like this in my .m file #import "EnterInviteCodeController.h" @interface EnterInviteCodeController () @property (nonatomic, retain) NSArray *items_array; @end @implementation EnterInviteCodeController @synthesize itemList; // UITableView But when I try to populate the list, no items show

How to open app on iPhone unlock

北战南征 提交于 2019-12-24 16:15:11
问题 I am trying to create an app that pops up like a second password screen every time the user unlocks the phone. User unlocks phone -> custom security app opens -> custom security app closes and pushes user to home screen Is this possible to capture the phone unlock event and open your app? Thanks! 回答1: Definitely not. Third-party apps don’t get that amount of control over the system. 来源: https://stackoverflow.com/questions/12573807/how-to-open-app-on-iphone-unlock

Fit image to UIImageVIew in a table view cell

偶尔善良 提交于 2019-12-24 15:37:21
问题 I'm trying to get centered and fit and centered an image called from URL in a UIImageVI in a table view cell with this code: NSData *imageData= [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:news.image_small]]; cell.imageView.image=[UIImage imageWithData:imageData]; cell.imageView.layer.cornerRadius = 5.0; cell.imageView.layer.masksToBounds = YES; cell.imageView.layer.borderColor = [UIColor lightGrayColor].CGColor; cell.imageView.layer.borderWidth = 1.0; cell.imageView.contentMode

Displaying checkmark on cells iOS 5

ぃ、小莉子 提交于 2019-12-24 15:33:21
问题 I am creating a basic checklist app and would like to know how to make a cell display a simple checkmark once it is touched. I have used no coding up to this point and have done everything in storyboarding. I have a single view that contains 10 cells. Each cell is a "task". I would like to display a checkmark on each cell as it is clicked. I know some basic objective-c but am not advanced. 回答1: the clue is within the accessory of a table cell, you should use something like cell.accessoryType

display data from sqlite to label using FMDB

爷,独闯天下 提交于 2019-12-24 14:36:30
问题 How to display data from SQLite to label using FMDB like this: I would like to display whatever the output is in this format for the user to see. No Interaction. Only display for the select query. 回答1: If you want to add UILabel objects, just iterate through your result set, adding labels to your view. Something like: NSInteger rowNum = 0; NSArray *columnWidths = @[@(50), @(120), @(75), @(75)]; CGFloat rowHeight = 24.0; FMResultSet *rs = [db executeQuery:sql]; while ([rs next]) { CGFloat x =

iOS Facebook SDK - getting friends emails

纵饮孤独 提交于 2019-12-24 14:34:30
问题 I am developing an iPhone application, and I want to be able to list the user's friends who are connected to my application and access their e-mails, if they have already granted my application access to their e-mails. This is the code I am using to open the Facebook session: - (BOOL)openSessionWithAllowLoginUI:(BOOL)allowLoginUI { NSArray *permissions = [[NSArray alloc] initWithObjects: @"email", nil]; return [FBSession openActiveSessionWithReadPermissions:permissions allowLoginUI

How to make my ios app appears in Location Services in the settings

陌路散爱 提交于 2019-12-24 14:16:14
问题 I wrote an CLLocationManager ios app. However, I cannot see my app appears in the Location Services in the settings on my iPhone. Do I need to set a specific value in plist in my ios project in Xcode? Thanks in advance! 回答1: It should appear automatically once code that actually requires location tracking is being called (whenever the popup first show: do you allow...) try calling something like this: [self.locationManager startUpdatingLocation]; And that should do it 回答2: In iOS -8 need to