uikit

UITableViewCell Custom Drawing and Animating when Entering Edit/Reorder Mode

I am trying to do something very similar to this post. Starting with Atebits Fast Scrolling in Tweetie post I have a UITableView subclass that does all of it's drawing in the drawRect: method of it's contentView. This works perfectly and is super fast. What I am trying to do now is animate the transition from editing to not-editing. ...

UIControlEvents and subclassing UIControl

I have a UIControl subclass for a custom slider type control (one that behaves differently from UISlider). At the moment I use my own target and action variables to send a message to the target whenever the slider value changes. But this doesn't play nice with Apple's UIControlEvent constants. I wasn't sure if I should use these, and if ...

How to configure UIButton to use showsTouchWhenHighlighted?

I have a UIButton that's 90x90 in size and I would like it to glow when tapped. Using showsTouchWhenHighlighted will make it glow but it's glowing out of the center of the button and for a small radius only. This might work well for a small button like the info button, but for my button size, it's not. Is there anything I can do to ma...

How to fire 10 messages per second?

Problem: I need to fire values to an object 10 times per second. I must be able to start firing and stop firing. I've discovered that the delegate of an UIScrollView gets notified in about the same time intervals, no matter how fast the scrolling is. You can easily see that if you NSLog the deltas from the offset changes. There must be ...

Force loading/unloading a view

How can I setup a view controller to refresh the fields in the view only it is pushed on a navigation controller and releases the objects when it is popped from navigation controller views. My goal is that for a view controller: Refresh display only when it is pushed on the navigation controller stack releases data when it is popped f...

Is it possible to pull for touch points immediately after touchesBegan: gets called?

Problably you know that iPhone OS makes an artifical delay of about 0.25 seconds after an touchesBegan: occures. This is to check if the user intends to move or not. If the deltas move significantly enough during this time, a touchesMoved: sequence starts. But when you want to implement tactile touch behaviour in your app, you may not w...

How could I handle touch events by using hitTest?

I found this little text on the net: UIScrollView overrides hitTest method and always returns itself, so that all touch events (touchesBegan, touchesMoved, touchesEnded, touchesCancelled) go into it. Then inside touchesBegan, touchesMoved etc it checks if it's interested in the event, and either handles or passes it o...

How do I know when a page has failed to load in UIWebView as opposed to being "Stopped" by the user?

Hey Guys, I have a UIWebView within my application which I'm using to provide web browsing functionality. I have a button on my toolbar which calls -(void)stopLoading; on the UIWebView. The problem with this is that when this method is sent to the web view, the delegate receives the - (void)webView:(UIWebView *)webView didFailLoad...

Opening popup links in UIWebView, possible?

Hey guys, I have a UIWebView which I'm using as an embedded browser within my app. I've noticed that links in webpages that open new windows are ignored without any call into my code. I've tried breakpointing on - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigation...

How to end an animation early in Cocoa Touch?

I have a UINavigationController onto which I push a 'loading screen' UIViewController whilst I asynchronously connect to a server. The push is implicitly animated with that sliding effect. If an error occurs whilst connecting, I pop the loading screen controller (again animated) and display an alert to the user. All is good if I pop ...

Is it possible to call a method automatically every time a value changes?

i.e. I have a layer's "transform.rotation.z" value which may change several times. Every time that value changes, I'd like to call a method. Of course I could call it just at any point where I touch that value. But maybe there's a more elegant way in objective-c / cocoa-touch? Somebody told me a few days ago that there's some notificatio...

How to store object + string pairs without retaining the objects, and what kind of storage to use?

I am implementing a class that has to store arbitrary objects together with a string. i.e. myUIViewObject, @"that's a nice view" myUIViewController, @"not really special" myOtherObject, @"very important one" this list can be extended and modified at any time, so I thought about using NSMutableDictionary here. But I am not really sure....

Does the memory address of an object stay intact over its lifetime?

I am not sure if the memory address of an object keeps beeing the same over its lifetime. Does it? Or does it change sometimes during the object's existence? ...

Is there a way to get the memory address of any object as an NSString?

I need to store the memory address of an Object as an NSString. Is there a special format specifier for that? ...

Problem playing audio after pausing with AVAudioPlayer

I have an issue with my AVAudioPlayer in which if it is paused, I cannot get it to play again. Calling [audioPlayer play] after it is paused returns NO rather than the usual YES. Any idea what could have caused this? Someone else has this same issue as well: http://www.iphonedevforums.com/forum/sdk-coding-help/750-avaudioplayer-doesnt...

Iphone application crashes when poping to rootController of UITabBar tab

Hello, I'm having this bug I can't figure out and it is making my head hurt. So, basically, in my iphone application I have UITabBar with some tabs each having UINavigationControllers inside. Something like this: someViewController *someController = [[someViewController alloc] myInit]; UINavigationController *someNav = [[UINav...

IPhone - After dismissing Modal View Controller - gap is left at top of page

When starting the app, if the user doesn't have login information stored, I want to display a modal view controller to force the entry of this information. I found through trial and error, that this had to occur in viewDidAppear of my root view controller. I tried to put it in viewDidLoad and viewWillAppear, but those didn't work unles...

Drop Shadow on UITextField text

how is it possible to add a shadow to the text which is in a UITextField? ...

How does a UIView know about an added subview's UIViewController?

in the case of say - (void)applicationDidFinishLaunching:(UIApplication *)application { ... [window addSubview:gameController.view]; ... } how does the view of gameController retain association to gameController? I've peaked through all of the Debugger variables and I see no association other than a boolean flag that it belongs to...

iPhone App Delete Badge

I'd like to replicate the visual style of the Springboard's delete badge when you want to delete an application. I've gotten it pretty close, but it's not quite right, and I get the feeling that Apple isn't rendering these on the fly, but rather has a set image that they use. I was wondering if anyone has done this before, or has such a...