cocoa-touch

Programmatically opening the settings app (iPhone)

Is it currently possible to go to Apple's Settings application from a third party iPhone application? It's currently possible to open mail, safari, etc. What about Settings? ...

How to create hotlinks on image?

I'm not sure what the iPhone version of this is called but in HTML it is an image map. Certain areas of the map route you to different pages. I'd like to use an image, mostly in a scrollview, that I can have certain areas perform different actions. For example, Chemical Touch, http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoft...

Cocoa/iPhone app, centering a label in a UIView

What's the best way to center a label in a UIView? If you do something such as UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(view.frame.origin.x / 2, view.frame.origin.y / 2, 50.0, 50.0)]; Then you're setting the origin point of the label to the center of the view. The best bet would be to set the center of the view to ...

Simpler Solution For Playing Audio on an iPhone

Apple lists (http://developer.apple.com/samplecode/AudioQueueTest/listing1.html) as a quick demonstration of playing an audio file. Is there a way to play an audio file with many less lines of code? ...

How do you insert an image into SQLite on the iPhone?

hello, I want to insert an image in sqlite3, i have created table using "create table table1(photo blob,name varchar(10));" Now i want to insert an image in to it,so what is syntax for insert image into it? and in another table i want to store location of the image so for second table what is my create table and insert table syntax. Can ...

iPhone SDK - NSStreamEventHasBytesAvailable / appendBytes: crashing

Disclaimer: I am an Xcode / iPhone SDK Noob. I am trying to establish a client-side TCP/IP connection to an existing server. Upon connection, I expect to receive some data about the server (version, etc.). When my connection is made, the NSStreamEventOpenCompleted event fires, so I know the connection is made. Next the NSStreamEventHas...

iPhone SDK: Convert Byte Array to NSString?

XCode Newbie Alert! I am reading data from a TCP/IP stream and am successfully receiving a byte array from the pre-existing server. I am now trying to find a way to convert that array to an NSString. I have found several examples, but am having a hard time getting my desired results. case NSStreamEventHasBytesAvailable: { NSDat...

How to remove cells from UITableView directly?

Hi, is it possible to remove a cell from UITableView directly, with animation? Without changing datasource and then reloading table data? Thanks. ...

UITableViewController and NavigationController

I'm having a problem pushing a UITableViewController onto a NavigationController. With the following code: ProblemEditController *problemEditController = [[[ProblemEditController alloc] initWithNibName:@"ProblemEditController" bundle:nil] retain]; problemEditController.problem = [[Problem alloc] init]; [self.navigationController pushVie...

Cocoa-Touch framework for speaking to a TCP socket?

I have a daemon running on a server that's latched onto a TCP/IP port. I'm looking to see if there's currently any support iPhone/Cocoa-touch frameworks that gives a nice OO wrapper for speaking to the daemon over an IP socket. I need to be able to interactively query the daemon with commands and retrieve back information. If there isn'...

CoreGraphics on iPhone, trying to draw a "pill" type ellipse

I'm trying to draw a pill type ellipse, as in Apple's Mail application which displays the number of emails in the inbox. Any idea why the following isn't drawing? - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGFloat minX = CGRectGetMinX(rect); CGFloat minY = CGRectGetMinY(rect); CGFloat ...

Open Source Cocoa/Cocoa-Touch POP3/SMTP library?

I'm looking to write a sample application speaking to a POP3/SMTP server. Instead of re-inventing the wheel with BSD sockets and CFNetwork type calls, I'm curious if there is currently any open source libraries that already take care of alot of the dirty work? I've tried Googling without much luck for anything. Perhaps there's something...

Easy way to dismiss keyboard?

I have quite a few controls scattered throughout many table cells in my table, and I was wondering if there's an easier way to dismiss the keyboard without having to loop through all my controls and resigning them all as the first responder. I guess the question is.. How would I get the current first responder to the keyboard? ...

Reuse Cocos2d CocosNodes

I am trying to create a cool score counter in my iPhone game, where I created the digits 0 to 9 in photoshop and I want to update the score every second. What I am doing now is the following: In my init I load all the digit sprites into an array, so that the array has 10 items. I created a method which breaks down the current score (e...

Replacing multiple array contents with a single object?

I have a mutable array with contents I want to replace with NSNull objects. This is what I do: NSMutableArray* nulls = [NSMutableArray array]; for (NSInteger i = 0; i < myIndexes.count; i++) [nulls addObject:[NSNull null]]; [stageMap replaceObjectsAtIndexes:myIndexes withObjects:nulls]; How can I do this more efficiently? Is the...

Animating custom-drawn UITableViewCell when entering edit mode

Background First of all, much gratitude to atebits for their very informative blog post Fast Scrolling in Tweetie with UITableView. The post explains in detail how the developers were able to squeeze as much scrolling performance as possible out of the UITableViews in Tweetie. Goals Beginning with the source code linked from the blog...

Which initializer(s) to override for UITableViewController subclass

I have a UITableViewController subclass that's instantiated, depending on where it's used, in a NIB or via code. In both cases I want to do customization in the initializer method. Does that mean I need to implement both initWithNibName:bundle: and initWithCoder:, and would each method call its respective super initializer? While I do...

UITableViewCell not getting updated.

For every entry in the table view cell, I need a button at right then some text and again a button at the left. At the button click event I need to change the text (left/right button clicked.) and remove either of the buttons depending on the text conditions. I am not able to remove the buttons using cellForRowAtIndexPath method. I tried...

iPhone Disabling UIActionSheet buttons

I want to disable buttons in the UIAction sheet and enable them after a certain condition is true. How do I achieve this? Any ideas? ...

Possible to redirect using only webpage?

I have a UIWebView that loads a URL through loadRequest in viewDidLoad. The user clicks a button in the RootViewController, which pushes the webview and a webpage appears. With only access to the webpage code, is there a way to redirect the user? I tried the META Refresh but that didn't have any affect. Links won't work since none o...