cocoa-touch

Change the resolution of image in iPhone?

I wanted to change the resolution of a image,this image I am getting from remote location.The image I am getting is too large to fit in iPhone screen is their any way to change that resolution? Thanks in advance ...

CoreAudio AudioFileStream

I use a modified version of AudioFileStreamExample (/Developer/Examples/CoreAudio/Services/AudioFileStreamExample/afsclient.cpp) to play streamed audio. My problem is now that if I try to stop the audio playback, the playback thread is blocked until MyAudioQueueOutputCallback is called. How can I stop it without waiting for the MyAudioQu...

What are best practices that you use when writing Objective-C and Cocoa?

I know about the HIG (which is quite handy!), but what programming practices do you use when writing Objective-C, and more specifically when using Cocoa (or CocoaTouch). ...

Object allocate and init in Objective C

What is the difference between the following 2 ways to allocate and init an object? AController *tempAController = [[AController alloc] init]; self.aController = tempAController; [tempAController release]; and self.aController= [[AController alloc] init]; Most of the apple example use the first method. Why would you allocate, init ...

Programatically align a toolbar on top of the iPhone keyboard

In several cases I want to add a toolbar to the top of the iPhone keyboard (as in iPhone Safari when you're navigating form elements, for example). Currently I am specifying the toolbar's rectangle with constants but because other elements of the interface are in flux - toolbars and nav bars at the top of the screen - every time we ma...

Cropping a UIImage

I've got some code that resizes an image so I can get a scaled chunk of the center of the image - I use this to take a UIImage and return a small, square representation of an image, similar to what's seen in the album view of the Photos app. (I know I could use a UIImageView and adjust the crop mode to achieve the same results, but these...

How do I scroll a UITableView to a section that contains no rows?

In an app I'm working on, I have a plain style UITableView that can contain a section containing zero rows. I want to be able to scroll to this section using scrollToRowAtIndexPath:atScrollPosition:animated: but I get an error when I try to scroll to this section due to the lack of child rows. Apple's calendar application is able to do ...

How to do string conversions in Objective-C?

I want to convert a string into a double and after doing some math on it, convert it back to a string. How do I do this in Objective-C? Is there a way to round a double to the nearest integer too? ...

How do I programatically zoom a UIScrollView?

I'd like to zoom and unzoom in ways the base class doesn't support. For instance, upon receiving a double tap. ...

How do I stop a UIScrollView from bouncing horizontally?

I have a UIScrollView that shows vertical data, but where the horizontal component is no wider than the screen of the iPhone. The problem is that the user is still able to drag horizontally, and basically expose blank sections of the UI. I have tried setting: scrollView.alwaysBounceHorizontal = NO; scrollView.directionalLockEnabled = YE...

UITableView didSelectRow while editing?

Hi, I'm building an interface much like the built-in Weather application's flipside view, or the Alarms view of the Clock application in editing mode. The table view is always in editing mode, so the delete icon appears on the left side of each cell. When the table view is in editing mode, my delegate doesn't receive didSelectRowAtInde...

What class handles the popup/notification windows on iphone?

I'm looking for the class name of the popup/message windows on the iPhone (it's a blueish window that comes up when you have a missed call, or a message comes in for example.) ...

How do I hook up a referencing outlet in Interface Bulider for a UIImage?

I want to access a UIImage programmatically... i.e. myImage.hidden = TRUE; etc. I can do this fine for UILabel but when I repeat the process for UIImage it doesn't work. Specifically when I drag the blue line in Interface Builder over the icon I don't get a popup menu like I do when using UILabel. Perhaps using UIImageView instead of ...

Way to discover which internet connection type I'm using on the iPhone

I need to know what internet connection is available when my application is running. I checked out the Reachability example from Apple, but this differs only between wifi and carrier network. What I need to know is what carrier network is selected, UMTS or EDGE or GPRS. ...

How to save picture to iPhone photo library?

What do I need to do to save an image my program has generated (possibly from the camera, possibly not) to the system photo library on the iPhone? ...

How can I add an additional "view" to my iphone app?

I have a simple iphone app that's based on the CrashLanding sample app. So basically you tap the title screen and do some stuff... all on the same "view". I want to add an "options" screen/page/view whatever with a few UISwitches. What's the easiest way to do this? Cheers! ...

Can any of the iPhone collection objects hold an image?

Actually, I wanted a custom cell which contains 2 image objects and 1 text object, and I decided to make a container for those objects. So is it possible to hold a image in object and insert that object in any of the collection objects, and later use that object to display inside cell? Thanks in advance. ...

Determining when an EDGE connection comes back after a dropout on an iPhone

I've incorporated Apple's Reachability sample into my own project so I know whether or not I have a network connection - if I don't have a network connection, I don't bother sending out and requests. I decided to go with the status notification implementation because it seemed easier to have the reachablity updated in the background and ...

Is there a documented way to set the iPhone orientation?

I have an app where I would like to support device rotation in certain views but other don't particularly make sense in Landscape mode, so as I swapping the views out I would like to force the rotation to be set to portrait. There is an undocumented property setter on UIDevice that does the trick but obviously generates a compiler warni...

NSAutoreleasePool in NSOperation main?

The documentation for +[NSThread detachNewThreadSelector:toTarget:withObject:] says: For non garbage-collected applications, the method aSelector is responsible for setting up an autorelease pool for the newly detached thread and freeing that pool before it exits. My question is, do I need to create my own NSAutoreleasePool in ...