iphone

NSNotification between sibling views

Using a UITabBar, I have 4 sibling views (one per tab item). When the app loads, the first tab item and view are visible. That first view has an IBAction that posts an NSNotification. Each of the other three views have observers for the notification but they cannot "hear" the notification until they are first made visible by touching ...

Styling UITableViewCells with gradient backgrounds

Hi folks, I've been looking for ways to improve the overall attractiveness of my iPhone applications. A majority of the functionality happens in UITableView. I think I can start by adding subtle gradients to UITableViewCells, as that seems to improve the feel of the app by an order of magnitude. Selecting the appropriate fonts/sizes hel...

Is there an iPhone SDK API for twitter?

mobclix.com has an API for integrating with facebook.com. Is there something similar for twitter.com and other social services? Meaning, these will look like native parts of your app? ...

Objective C strip out whitespace from NSString

How do I strip out the white space chars from an NSString ? Consider the following example: NSString *tmpString = @" Hello this is a long string! "; I want to convert that to: "Hello this is a long string!". I have tried a function like this, but it's not working: -(NSString *)cleanupString:(NSString *)theString {...

IPhone OpenGL ES single or multiple views?

I'm confused on what the best approach is when writing a game for the iphone. The game will be rendered with OpenGL , but im curious when creating the Start Screen, Menu's, High Score page, etc. Do you do all of that with OpenGL or do you create additional UIViews and use the UIKit? ...

Best Book or Article to learn iphone development

i am new to iphone development.. so from where i should start learning... pls tell me step by step to guide ...

[iPhone] Objective-C array of objects misbehaving (EXC_BAD_ACCESS) in TableViewController

Hello stackoverflow. I'm new to Objective-C, and I can't figure out why the NSString objects in my array of Car objects seem to have been released. Here's my Car.m class: #import "Car.h" @implementation Car @synthesize categoryId; - (id)initWithPrimaryKey:(NSInteger)pk categoryId:(NSNumber *)catId carName:(NSString *)n { if (self...

How to seek the streaming audio in iPhone?

Hi all, I need to develop an audio streaming application ,which has the capability to play,pause and seek(fast forward)...I have implemented the all operations except seek..I am using Matt's audio streaming sample code(http://cocoawithlove.com/2008/09/streaming-and-playing-live-mp3-stream.html)...Can anybody explain in detail about how ...

iPhone / Objective C nested C structures

Hi, Can someone confirm that nested C structures are NOT allowed in objective C. And by nested structs, I mean the following; struct Tex2D { GLfloat u; GLfloat v; }; // quad uv cords struct TexQuad { Tex2D uv[4]; }; I seem to have all kinds of problems compiling this. It's difficult to find any documentation on this as ...

UITextView background image

Hi, how can I add a background image to UITextView? Thanks. ...

iphone : Poor UIImageView Performance

Hello Every one I'm working on google maps app for iphone i'm stuck with the way the UIImagView created moves on the screen, Besides that i have created 3*3 UIImageViews so that i can gather good amount of data on one go... But the movement of image not good i'm doing horizontalOffset = mapCenterImgView.center.x; final_x = touch.x - h...

How to implement ball movement using vector formula?

Hi All.... I am doing ping pong game where I have to move ball and detect collision with outside boundary and also with moving paddle. I want to implement it using vector and not by trigonometry. I am very weak in math,so kindly guide me. ...

iPhone Keeping the last row selected of UITableView

I am inserting every row to the UITable view using cellForRowAtIndexPath method. Now I need to always keep the last cell of the table view always selected. i.e. Whenever a new entry is added is should be in selected state and when it is deleted the previous entry of the table view must be in selected state. I tried using selectRowAtIndex...

How to reference HTML anchor?

I'm loading a string of HTML into a UIWebView through loadHTMLString. It produces a very long webpage. Once that string is loaded, I need to navigate to an HTML anchor tag with its "name" attribute set. In the HTML, I might have: //3 pages of text here <a name="go here"></a> lots more text here //another 3 pages of text here I need...

iPhone/Cocoa: NSPredicate regex replace?

According to this guide, I can use NSPredicate to do regex matching on strings, i.e., the perl equivalent of $my_string =~ m/[some regex]/ But can I do regex replace, i.e. the equivalent of this perl expression: $my_string =~ s/[pattern]/[replacement]/g ? ...

UIACtionSheet Delegate Question

I am using an action sheet to alert a user to several items upon logging into my app. listed are some examples of the alerts and the buttons that go with them. INVALID USER - OK INVALID PASSWORD - OK INVALID USER - OK UNKNOWN USER - CREATE NEW USER, CANCEL USER ALREADY LOGGED IN - DISCONNECT, CANCEL LOGIN What is the best way to manag...

Making sense of the 'leaks' command line utility for finding memory leaks

Hi all, I'm working on tracking down some difficult to find memory leaks in my iPhone program. I'm running a quick test on an app which leaks an NSString object with the following intentionally -incorrect- code: -(void)applicationDidFinishLaunching:(NSNotification *)notification; { NSMutableString *test = [[NSMutableString alloc] i...

WiFi connection is dropped after user inactivity period

My iPhone application establishes a TCP connection through wifi to a remote server. However, if there is no user activity for a certain time, the device closes wifi and drops the connection. Is it possible to prevent it? I need the connection to be persistent while the application is running. Setting setIdleTimerDisabled:YES doesn't help...

Best way to learn iphone audio queue services, step by step tutorial

I'm trying to learn how to handle audio at a fairly low level with audio queue services. I have been progrmaing in memory managed languages for quite a while, and have just completed the c programing tutorial by vtc (2007). This has left me comfortable with the understanding of pointers and memory allocation, but the apple documention ...

HttpBasicAuthentication in IPhone

Hi All, In my iPhone app, i am trying to display an image on iphone from my server, which needs authorization. I am trying to use NSURLConnection to get the image, but it is not asking me for the user credentials. i.e it is not at all going to didReceiveAuthenticationChallenge method. Can anyone help me with this issue. Thanks, nbojj ...