cocoa-touch

UIView Animation Flip With Axis on at Top of View

房东的猫 提交于 2019-12-25 02:18:48
问题 I have a UIView that I would like to animate a flip up. This isn't like UIViewAnimationOptionTransitionFlipFromTop because that places that axis in the middle of the view. I would like to have the axis at the top of the view, so that it flips up similar to how a pad of paper flips from the top axis (NOT a page peel). [UIView transitionWithView:self.view duration:0.6 options:UIViewAnimationOptionTransitionFlipFromTopAxis // <---- Wish there was an option like this animations:^{ // Exchange the

App crashing when downloading a large file - NSFileHandle seekToEndOfFile

*爱你&永不变心* 提交于 2019-12-25 02:18:20
问题 I have a loop that gets the URLs of a bunch of files (10 small txt files and 1 large image file around 700KB) and runs 'getFile' which creates an NSUrlConnection for each one. When the app gets to [file seekToEndOfFile] just before [file writeData:data] it crashes with: *** Terminating app due to uncaught exception 'NSFileHandleOperationException', reason: '*** -[NSConcreteFileHandle seekToEndOfFile]: No such process' *** First throw call stack: The strange thing is that if I step through the

More Precise CGPoint for UILongPressGestureRecognizer

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-25 02:16:29
问题 I am using a UILongPressGestureRecognizer which works perfectly but the data I get is not precise enough for my use case. CGPoints that I get are rounded off I think. Example points that I get: 100.5, 103.0 etc. The decimal part is either .5 or .0 . Is there a way to get more precise points? I was hoping for something like .xxxx as in '100.8745' but .xx would do to. The reason I need this is because I have a circular UIBezierPath, I want to restrict a drag gesture to only that circular path.

Selector Sent to method overridden in Category fails

眉间皱痕 提交于 2019-12-25 01:55:32
问题 I am trying to override a UIStoryboard method using a category. Here is my implementation: #import "UIStoryboard+SomeCategory.h" #import <UIKit/UIKit.h> @implementation UIStoryboard(SomeCategory) -(id)instantiateInitialViewController { NSLog(@"SUPER CLASS: %@", [super class]); // logs "UIStoryboard" NSLog(@"SUPER RTS : %@", [super respondsToSelector:@selector(instantiateInitialViewController)] ? @"YES" : @"NO"); // logs "YES" return [super instantiateInitialViewController]; } @end when I add:

iAd appears on simulator but not on device

孤街浪徒 提交于 2019-12-25 01:55:07
问题 When I run app on simulator(4.0), iAd is appearing as Test advertisements. But when I deployed the app on ipod(4.0) , iAd is not appearing, even as Test advertisements. Please help me out as early as possible... I m from India... Regards... 回答1: Where are you from? Maybe iAd is not available in your Country!. Be sure your device is connected to Internet (WiFi or 3G). To implement iAd in your application you need to import the iAd framework to your project and #include it to the ".h" of the

Reach the end of the tableview without using 'numberOfRowsInSection' delegate method iphone sdk

痞子三分冷 提交于 2019-12-25 01:48:27
问题 I want to add a view after the last cell of tableview. I need to define the frame for it. If I want to add something before the first cell, then I can set the frame as refreshHeaderView = [[EGORefreshTableHeaderView alloc] initWithFrame:CGRectMake(0.0f, 0.0f - self.view.bounds.size.height,320.0f, self.view.bounds.size.height)]; But how to find the y coordinate of the frame of view to be set after the last cell. Thanx in advance. 回答1: The tableview subclasses scrollView, so, to answer your

Need to filter certain UIWebView requests and load them in different UIWebViews

泄露秘密 提交于 2019-12-25 01:46:02
问题 Some Background I have an iPhone app with three UIWebViews, each used to show a different type of page. (The content is specifically designed for this purpose, they're not real web pages.) There are links associated with each specific web view. For example, a link tapped in WV1 might need to load in WV2 because it's a WV2-style link. (The webviews are in a paged UIScrollView, which I use to scroll to the currently loading webview. I can tell which URL loads where based on it's path.) It makes

Make this view appear in every view, inside the app

梦想的初衷 提交于 2019-12-25 01:45:16
问题 This is a "curtain" hanging down from my navigationbar. How can I have make this view as an overlay on all views in my app? I must be able to add images to this overlay's subviews 回答1: Simply add it to your application's key window . That will overlay everything. [[[UIApplication sharedApplication] keyWindow] addSubview:curtainView]; I use this method to present a full-screen progress indicator overlay (a singleton actually) to block the UI during some activities, regardless of context.

UITextView not showing text until I rotate it

匆匆过客 提交于 2019-12-25 01:43:43
问题 I'm using a UISplitViewController, with a view that has a UITextView as the master view, but the text does not load until I rotate the ipad twice. Logging when the app starts shows that the text view is available and the text inside it (which is defined in the nib file) is also loaded properly. What am I doing wrong? 回答1: It seems like I've found the limit to how many characters can be initially loaded into UITextView in a UIPopoverController (for portrait mode in UISplitViewController). The

How to set my own ViewController class as the first screen (root view)

妖精的绣舞 提交于 2019-12-25 01:38:00
问题 I have created a windows based project in XCode using IPhone as target platform and then I added a ViewController Sub Class. Now I want to make my newly added class to be shown at first screen. What is the proper way to achieve it? Regards. 回答1: Modify your appdelegate, you'll find something like this: [window addSubview:myView]; [window makeKeyAndVisible]; Change my view to the view you want to show first. 回答2: That is the correct way i found first declare your view controller in appdelegate