cocoa-touch

I need to return a string in cocoa after http request and xml delegates are complete??

I have the following delegate method of NSURLConnection - (void)connectionDidFinishLoading:(NSURLConnection *)connection { NSLog(@"DONE, Receive bytes: %d", [webData length]); NSString *theXML = [[NSString alloc]initWithBytes:[webData mutableBytes] length:[webData length] encoding:NSUTF8StringEncoding]; //NSLog(theXML); [theXML ...

drawAtPoint: and drawInRect: blurry text

When drawing strings using drawAtPoint:, drawInRect: and even setting the text property of UILabels - the text can sometimes appear slightly blurry. I tend to use Helvetica in most places, and I notice that specific font sizes cause some level of blurriness to occur, both in the simulator and on the device. For example: UIFont *labelF...

How does UIPickerView handle 2+ dials spinning?

If I have a UIPickerView with three components (dials). How does the picker handle two dials spinning simultaneously? For example, the user might flick the first dial, which spins freely and immediately slowly click to a selection on the second dial. I'm doing the following in the picker. If one dial is spinning, I don't capture it...

Error Message: MPMoviePlayerController instance is already playing

In my app I am playing video(s) that are in the app, using the standard MPMoviePlayerController class. The first time around around this works great, however after watching 1 video if you try and watch something else the app crashes on MPMoviePlayerController's play method with the error: *** Terminating app due to uncaught exception '...

How can i get the configured Emails in iPhone

Hi I need to get the user emails those are configured in iPhone using cocoa touch. How can i do that . Thank you for answers . ...

Open an app part way down a NavigationController's view stack.

I am working my way through the book "Beginning iPhone Development" and understand the basic view push concept. However Apple's iPhone UI design guide states that I should re-open my application at the previous app-exit view. How can I boot a NavigationController so that it defaults to a child view and yet has a view stack that returns t...

Sharing Data between Views through App Delegate

I have a question about sharing data between views, hopefully it's not too basic. I have an NSMutableArray in an appDelegate with say (Object1, Object2, Object3). When a new Object is created (and added to the array), I need to access that Object on the next view. Previously I was just passing the Object to the next view, but that got me...

Optimization UITabBarController + UITableViewController problem

I wanted to start a optimization thread. I have ran into an interesting situation, I have an iPhone app with 3 UITableViews each displaying more or less the same data (you can say it's a matter of filering). To date I had 3 separate NIBs for this, each with it's own controller, additionaly the UITableViews were inside UINavigationContr...

Change Default Scrolling Behavior of UITableView Section Header

I have a UITableView with two sections. It is a simple table view. I am using viewForHeaderInSection to create custom views for these headers. So far, so good. The default scrolling behavior is that when a section is encountered, the section header stays anchored below the Nav bar, until the next section scrolls into view. My questi...

UIBarButtonItem with color?

Is it possible to have a red UIBarButtonItem? ...

NSNumberFormatter to format US Telephone Numbers

I'm trying to convert a string of numbers, entered by the user, into a sexy string like Phone.app on the iPhone. Here is the code I'm using, which doesn't work (no special format comes out) and after a certain number of digits it just starts adding "0" to the end of the string. NSNumberFormatter *formatter = [[NSNumberFormatter alloc] i...

How to release memory associated by CGImageCreateWithImageInRect

I am using CGImageCreateWithImageInRect() for generating a small image from a background image runtime, which is going to displayed for every thread call (0.01 sec). Once I start showing part of image through CGImageCreateWithImageInRect application starts consuming memory in very high rate and crashes within seconds. Memory consumed goe...

Interface Builder "Simulate Interface" not working

I am using Interface Builder to play around with some ideas. I never noticed that there is a "Simulate Interface" feature which apparently will render the nib in the iPhone simulator. So, I created a view, put one component in there (a Segmented Control), saved it, selected "Simulate Interface", the simulator launched but... nothing rend...

Best approach to debugging applicationDidReceiveMemoryWarning on iPhone?

Need advice on how to debug this. I'm new with limited environments and have no previous embedded or smart phone programming experience so I could use some clues. Already aware of: Instruments, Clanger Static Analysis, manual code review, etc. Instruments seems to be very helpful in general but quite time consuming and freezes up a lot o...

Is this a valid use of an Objective-C pointer?

This is a beginner level question in which I'm curious if this is a valid use of a pointer in a statement such as: NSMutableDictionary *foo = [bar mutableCopy]; I get confused when that is valid versus when I'd need to do the following: NSMutableDictionary *foo = [[NSMutableDictionary alloc] initWithCapacity:0]; foo = [bar mutableCo...

(iPhone) selectedRange for a non-editable UITextView (or other methods of click handling?)

Hello all, I'm using an UITextView to hold static content (in Chinese, which means that the characters are all fixed width). I want to let users click on a character in the text and bring up dictionary information for that character. I know all of the issues surrounding the lack of copy and paste and all that, but I'm hoping that there ...

Trying to find a proper context for drawing a UIImage in a UIView

I am trying to draw a background image in my UIView. This is in a UIAlertView delegate method alertView: I pop the context because before this I was using a context in a OpenGL view called game. UIGraphicsPopContext(); UIImage* background = [UIImage imageNamed:@"Background.png"]; [background drawAtPoint:CGPointMake(0.0, 0.0)]; // fade ...

Best way to reference image through out app?

My application is database driven. Each row contains the main content column I display in a UIWebView. Most of the rows (the content column) have a reference to image1 and some to image2. I convert these to base64 and add the image string into the row. However, if either image changes, it means I have to go back through all the rows ...

NSURLConnection, NSURLRequest and remote caching

I'm having a small problem with request caching using NSURLConnection asynchronous connections on the iPhone. I don't know if I understood something incorrectly, or if Cocoa is doing the opposite to what it's supposed to do... The documentation for NSURLRequest says that: NSURLRequestReloadIgnoringLocalCacheData Specifies that ...

MPMoviePlayerController and UIWebView

I'd like a link in a UIWebView that plays a local .mp4 file. I know how to load the MPMoviePlayerControler but am not sure how to set it up in the UIWebView. I have a UIView with a UIWebView inside of it. How do I use the MPMoviePlayerControler with this setup? ...