cocoa-touch

Creating a "loading..." view using iPhone SDK...

How to create that black/gray modal popup kind of view that many apps use, when some long pending operation is in progress? Like when using location based services, loading a webpage, the screen goes dim and there is a modal view showing a spinning icon "Please wait..." I've posted a screenshot of what I mean here... http://www.flickr....

NSURLConnection - how to wait for completion

Our iPhone app code currently uses NSURLConnection sendSynchronousRequest and that works fine except we need more visibility into the connection progress and caching so we're moving to an async NSURLConnection. What's the simplest way to wait for the async code to complete? Wrap it in a NSOperation/NSOperationQueue, performSelector..., ...

How can I store a string in an sqlite3 Database on iPhone OS?

I'd like to see some sample code for that. Any good Tutorial-Link is also welcome. ...

Are there any third-party libraries to do cool view transitions in iPhone OS?

I don't really like that flip-transition. It's boring. I'd like to see something cool, like water effect, fog, or whatever. Is there something available or do I have to (re)invent the wheel for that? ...

Is there a way of setting some kind of z-index for z-position of UIImageView objects?

I'm building up a grid of images, and I start at the top, creating UIImageView objects all over the place. Now I want that they overlap a little bit, but the last ones I draw are the ones most on top. I'd like to set the z-position programmatically, so that the first ones I draw will be the ones most on top. ...

Better performance with libxml2 or NSXMLParser on the iPhone?

Hi everyone, I'm curious what your solution is for high performance XML parsing on the iPhone is, given its limited amount of CPU power. I have reviewed the XML Performance App that Apple provides as a demonstration, and it seems that for the data feed (300 iTunes songs) that they're parsing.. libxml2 always seem to come as the forefron...

How can I outsource view-change-operations from my view controller upon accelerations?

I have an view controller class. I want to do some things in my view when the accelerometer detects movement and calls the accelerometer:didAccelerate: method in the delegate object. That delegate object is the problem here in my brain. Currently, my brain is freezed and I don't get it what would be better. Let me know what you think! ...

iPhone image button

Hi, I want to use image buttons in my iPhone application. Could you please let me know if there is any article I can read on this. Thanks. ...

Why should I check for [self class] == [LevelAppDelegate class] in an initialize method?

In the AppDelegate of the BubbleLevel example from Apple they do something like this: + (void)initialize { if ([self class] == [LevelAppDelegate class]) { // Register a default value for the instrument calibration. // This will be used if the user hasn't calibrated the instrument. NSNumber *defaultCalibratio...

mysterious +initialize method in UIApplicationDelegate protocol: Why can't I see it in the documentation?

In the BubbleLevel example from apple they implement an +initialize method. They say: +initialize is invoked before the class receives any other messages, so it is a good place to set up application defaults But when I try to look it up in the UIApplicationDelegate protocol documentation, they don't even mention that +initial...

What describes the Application Delegate best? How does it fit into the whole concept?

Well I think to know what the App Delegate does. It has some nice methods like -applicationDidFinishLaunching which will be called when the app has finished launching, and so on. But what's that actually? Is that some object instantiated in the UIApplicationMain function? And how does it work that every class in my app has access to tha...

How can I round a float value to 2 post decimal positions?

I've got a float value from an accelerometer which looks like this: -3.04299553323 I'd like to get -3.04 for example. Is there an easy way for rounding that float value? Edit: http://stackoverflow.com/questions/752817/rounding-numbers-in-objective-c ...

Thread.sleep in objective -c

In Java you can suspend the current thread's execution for an amount of time using Thread.sleep(). Is there something like this in Objective C? ...

How to display key values in toolbar which is on keyboard

Hi to all I am developing one application. In that I have toolbar on keyboard. But I want that when I press keys, the key values should be displayed in toolbar textfield. So if anyone knows kindly reply. ...

How can I invoke a method upon scrolling-events in a UIScrollView?

I've got an UIScrollView object where I want to implement some effects happening when the user is scrolling. Is there a way to invoke a method on my view controller class every time the user starts a scroll action or is scrolling? What I need is also the current scrolling position. I am almost sure that there is something useful availab...

NSOperation on the iPhone

I've been looking for some concrete scenarios for when NSOperation on the iPhone is an ideal tool to use in an application. To my understanding, this is a wrapper around writing your own threaded code. I haven't seen any Apple demo apps using it, and I'm wondering if I'm missing out on a great tool instead of using NSThread. The ideal s...

How can I implement a circular scrolling mechanism?

I'm having some images from which the user should choose one. Now I don't want to just offer an flat scrolling area with a boring grid. Instead, I'd like to show up a wheel that contains those images. At the top would be a marker indicating the selection. Something similar to the Pickers. The problem is not the rotation stuff; I'd use s...

How can I set the scrolling position of an UIScrollView?

I've seen the setContentOffset:animated: method. Is that going to scroll to a specific position, or what does that "offset" mean? ...

Why does my -scrollViewWillBeginDragging method of my UIScrollView delegate return such a strange contentOffset value?

PROBLEM SOLVED! STUPID TYPO IN MY CODE! That's my method of my UIScrollView delegate: - (void)scrollViewWillBeginDragging:(UIScrollView *)activeScrollView { NSLog(@"contentOffset: %f", activeScrollView.contentOffset); } Output in console is like: 2009-05-06 23:04:45.731 Demo[4851:20b] contentOffset: 21080643979530096233938944.00...

iPhone application keyboard

Hi All, I want to add buttons like previous, next, done, Go when I am filling out some text fields in my iPhone application. Could you let me know how can I do that? Thanks. ...