ios7

UITextview text not showing top lines after rotation in iOS7

强颜欢笑 提交于 2019-12-14 01:27:10
问题 I have an app that contains a UITextview that displays static text. I used a UITextview to get scrolling for the text, which is much longer than can be displayed in a UILabel. For some reason, the text in a UITextview under iOS 7 does not stay scrolled to the top after a rotation. This works as expected when run under iOS 6. This can be shown by creating a project with a UITextview that is centered on the storyboard with margins around 50. Then add constraints that pin the UITextview to the

Getting UITableViewCell from its superview iOS 7 issue

白昼怎懂夜的黑 提交于 2019-12-14 01:20:09
问题 I have few UI objects in the cell that have got gesture recognizer instance. I need to get cell where pressing object is located. I have the method below for getting it, but it just work before iOS 7: UITableViewCell *cell = (UITableViewCell *)[[[sender view] superview]superview]; for iOS 6 it return UITableViewCell for iOS 7 it return UITableViewCellScrollView I think the new cell has some additional views in iOS 7, that's why I grab UITableViewCellScrollView instead of UITableViewCell as

How to make UI with round image and round text, also add ratting icon on same circle. in iOS application

℡╲_俬逩灬. 提交于 2019-12-13 23:22:13
问题 How to make UI with round image and round text, also add ratting icon on same circle. in iOS application 回答1: Import roundImageView.h class in your view class and set background image on your UIButton. Please change button type Custom . After Following these steps try this code . CGRect frame = CGRectMake(0, 0, 200, 200); roundImageView *roudImage = [[roundImageView alloc]init]; UIImage *image1 = [roudImage createMenuRingWithFrame:frame :@"Your Title" labelBgColor:[UIColor colorWithRed:(191

how to add values from nsstrings in iOS?

半腔热情 提交于 2019-12-13 23:11:44
问题 I have 5 buttons. Each button has some value like 1,2,3,4,5 in a string named totalSeats_selected . I want to save them into a nsstring that shows result like this: nsstring * result = [1,2,3,4,5]; These values are to used as request for a web service, so it must be in this format to send total number of seats? So, how to save all these values in nsstring on button event? 回答1: Use like this.Suppose your string is in integer means use Method 1 .otherwise use Method 2(If your value assigned in

RSA Encryption File larger than PublicKey

笑着哭i 提交于 2019-12-13 22:14:37
问题 With the following method i can successfully encrypt a NSData-Object which is not bigger than the 256Bit: OSStatus SecCertificateCopyPublicKey ( SecCertificateRef certificate, SecKeyRef *key ); - (NSData *)encryptWithData:(NSData *)content { OSStatus result = -1; NSData *plainTextData = content;//[@"123456789" dataUsingEncoding:NSUTF8StringEncoding]; size_t plainTextLength = [plainTextData length]; SecTrustRef trustRef; SecTrustResultType trustResult; SecPolicyRef policy =

Extracting price from string

谁说我不能喝 提交于 2019-12-13 21:10:04
问题 I am looking for a short and convenient way to extract a product's price from NSString. I have tried regular expressions, but always found some cases where did not match. The price can be any number including decimals, 0 and -1 (valid prices: 10, 10.99, -1, 0). NSString can contain a string like: @"Prod. price: $10.99" Thanks! 回答1: This will match all the examples you have given -?\d+(\.\d{2})? Optionally a - , followed by 1-many digits, optionally followed by a decimal point and 2 more

How to stretch iOS UITabBarItem background in iOS

妖精的绣舞 提交于 2019-12-13 21:06:25
问题 This is what I'm using now: tabBarController.tabBar.selectionIndicatorImage = [UIImage imageNamed:@"image.png"]; I have a couple pixels a of a solid color and I would like to stretch it the full width and height of my tabBarItem How would you do this? 回答1: This should help solve your problem tabBarController.tabBar.selectionIndicatorImage = [[UIImage imageNamed:@"image.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; From Apple documentation During scaling or resizing of the

iOS 7: Cannot connect to IBOutlets, probably because I'm using UITableViewController

独自空忆成欢 提交于 2019-12-13 17:58:09
问题 I cannot create any IBOutlets. I'm using a tableviewcontroller instead of a viewcontroller. When I click on TableViewController, the class is UITableViewController and I can't change that. Here's my code for ViewController.h: // ViewController.h // Tips4 // // Created by Meghan on 1/20/14. // Copyright (c) 2014 Meghan. All rights reserved. // #import <UIKit/UIKit.h> @interface ViewController : UIViewController <UITableViewDelegate, UITableViewDataSource> @property (strong, nonatomic) IBOutlet

Opening BasicMenu.xcodeproj fails on the new ECSlidingViewController 2

妖精的绣舞 提交于 2019-12-13 17:55:26
问题 Is it possible to open the BasicMenu.xcodeproj on xcode on the new version of ECSlidingViewController without having to do it via Examples.xcworkspace? I am trying to just work through the BasicMenu example specifically and when I do I get this error: ld: library not found for -lPods clang: error: linker command failed with exit code 1 (use -v to see invocation) 回答1: No, the dependencies to ECSlingViewController won't be available. You should be able to work with the BasicMenu project inside

Detect the “access code” portion of a conference call phone number in an NSString

纵然是瞬间 提交于 2019-12-13 17:20:48
问题 Given an EKEvent that represents a calendar entry on an iOS device, I'm trying to detect not only a phone number but also the related conference call access code. For example, given: NSString *text = @"Blah Blah Blah (555) 123-4567 Access Code: 9876# Blah Blah Blah"; I'd like to implement a method that would return this value: @"555-123-4567,,9876#" Calendar entries might use various text besides @"Access Code: " to describe the number used to access a conference call. For example, other