ios6

iOS Colorwithpattern - using a custom iPhone5 image

余生长醉 提交于 2019-12-05 07:57:57
For my app's loading screen and splash screen, I used up with two different methods to display my iPhone 3, iPhone 4 and iPhone 5 images appropriately. For the loading screen, simply adding -568h@2x to your image is enough to support iPhone5. For the splashscreen, I used a series of (if height == ) cases to check the height of the UIScreen's bounds and sourced the appropriate image to the image view. It was apparent to me here that the -568h isn't universally recognized as an iPhone 5 image. It is only applicable to the loading screen. Now, in my AppDelegate, I'm setting a the background image

iPad iOS memory management - how to free up “Real Memory” used by UIImageViews, UIScrollViews?

久未见 提交于 2019-12-05 07:57:54
I'm having memory issues with one of my apps and I've identified "Real memory" as defined in Instruments> Activity monitor as a possible culprit. My app allocates large UIImages within UIScrollViews . There's a CIImageFilter applied to one of the images. Activity monitor shows that upon the first pushing of the view controller containing scrollviews with large images, the real memory use jumps to around 300mb. Subsequent pushes/pops raise it to about 500mb: I read that "Live Bytes" does not count memory used by textures and CALayers, so my question is: How do I properly release memory that is

Convert date to next day's date in iOS

流过昼夜 提交于 2019-12-05 07:07:08
问题 I have a date in string format just like 30-11-2012 . I want the date next to it like 01-12-2012 again in string format. Is there any way of getting it? 回答1: You should use NSCalendar for best compatibility NSDate *today = [NSDate dateWithNaturalLanguageString:@"2011-11-30"]; NSCalendar *calendar = [NSCalendar currentCalendar]; NSDateComponents *dayComponent = [NSDateComponents new]; dayComponent.day = 1; today = [calendar dateByAddingComponents:dayComponent toDate:today options:0]; //2011-12

Program run on iOS 5.1 device can't find SDK with Xcode 4.5

岁酱吖の 提交于 2019-12-05 06:07:25
When i run my project at iOS 5.1 simulator , it shows yld: lazy symbol binding failed: Symbol not found: _objc_setProperty_nonatomic_copy Referenced from: /Users/apple/Library/Application Support/iPhone Simulator/5.1/Applications/3A003E5F-2C66-494F-BCC1-C3EE82F01464/dogTree.app/dogTree Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/Foundation.framework/Foundation And I don't have 5.1 SDK. But why library search path is 5.1 not 6.0? All my project and be run at iOS 6.0 device, but when I

how to support custom graphics in iPhone 5

删除回忆录丶 提交于 2019-12-05 05:48:28
问题 How to support custom graphics in iPhone 5, 4 inches display. I know that for Default it's need to add -568h prefix and it's work when my status bar is hidden and my background image size is 640 x 1136 px. But when I need to add custom background for the screen that size smaller then 1136 px it doesn't work. So how to support custom graphics in new retina display? 回答1: You can use my three #define s: #define isPhone568 ([[UIDevice currentDevice] userInterfaceIdiom] ==

UITextField autocapitalizationType UITextAutocapitalizationTypeAllCharacters not working on device

别来无恙 提交于 2019-12-05 05:31:27
You can set the autocapitalizationType property of a UITextField so all input is in upper case. I find that does work fine on the simulator (when actually tapping the simulator's keypad, not the Mac's keyboard), but not on the device? Everything stays lowercase. In the UICatalog demo I added to the textFieldNormal method: textFieldNormal.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters; Added a delegate too, to display the actual autocapitalizationType for the UITextField: - (void)textFieldDidBeginEditing:(UITextField *)textField { NSLog( @"textField.autocapitalizationType=%d

Indexpath of the button from UICollectionView

我的未来我决定 提交于 2019-12-05 05:19:40
I tried to: - (IBAction)delete:(UIButton*)sender{ NSIndexPath *indexPath = [self.collectionView indexPathForCell:(TourGridCell *)[[[sender superview]superview]superview]]; } But NSLog shows that cell exist, but indexpath is nil. OK, here it is: - (IBAction)delete:(UIButton *)sender{ NSIndexPath *indexPath = nil; indexPath = [self.collectionView indexPathForItemAtPoint:[self.collectionView convertPoint:sender.center fromView:sender.superview]]; } Sometimes it's the simplest possible answer. I was having exactly the same problem as @Schmidt, but was frustrated to see that his answer was to use

iOS - beginning iOS tutorial - underscore before variable?

家住魔仙堡 提交于 2019-12-05 05:14:30
I am starting to learn how some iOS development at the minute and I currently have the Apress beginning IOS6 book that I am working off. In chapter two there is a simple tutorial to show two buttons and a label and when a button is pressed it is shown on the label which one was pressed. I have completed the tutorial but it has raised one question that I can't find the answer to. The tutorial uses ARC (automatic reference counting) in case that makes a difference. Here is the code, The header file: #import <UIKit/UIKit.h> @interface MTMViewController : UIViewController @property (weak,

How to get path of image form Resource of main bundle

試著忘記壹切 提交于 2019-12-05 05:06:44
i have an iPhone application in which i added images directory (Group) in to Resources (group). i want to access that images which is in images . I need a path to that images so i create a code like following. NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"myImage1" ofType:@"png" inDirectory:@"images"]; NSLog(@"%@", imagePath); Result : (null) i also tried this code NSString *imagePath = [[NSBundle mainBundle] pathForResource:@"myImage1" ofType:@"png"]; But this code gives me (null) result. myImage1 's path is Resources/images/myImage1.png I don't know what is the problem.

how to play online video those are on server

假装没事ソ 提交于 2019-12-05 04:40:07
问题 I have videos on my server. I would like to play those video on iPhone and iPad. Could anyone suggest how to deal with such case? I know how to play video when the same video is in my project using MPMoviePlayerController . 回答1: You can use WebView to play video. In .h file add this code : #import <MediaPlayer/MediaPlayer.h> @interface VideoViewController : UIViewController<UIWebViewDelegate> @property (nonatomic, strong) UIWebView *playerView; And in .m file : @synthesize playerView; - (id