iphone-sdk-3.0

How to recognize the touch of a non regular sprite image ?

I have a sprite and if it is touched the touch should be recognized. I used the coordinates to do so. I took the coordinates (min x, min y, max x , max y)of the sprite image. But The sprite image is not a rectangular shape. So, even if I touch the coordinates outside the sprite and inside the rectangular bounds the sprite is recognized....

iphone - presenting an alertview with the right orientation

I have to present an alertview when my app starts. My app supports both landscape modes. Despite the landscape mode the device is when the app starts the alertview always shows in portrait. I have tried to use the accelerometer to detect the interface orientation before the orientation notification and I have the correct orientation 2...

Tips on implementing a custom UITextView interface on the iPhone?

I am trying to implement a control to edit text that will display the text in multiple colors. None of the solutions I have attempted yet have been good enough. UITextView cannot accomplish this. All of the text must be the same color. Using CoreGraphics to draw the text does not allow the text to be selected. Using a UIWebView, DIV ...

mkmapview userlocation annimation issue

I have issue with userlocation in mkmapview. The thing is that i have navigation controller which pushes mapview , as soon as it pushes it userlocation is queried. But if user pop mapview view before userlocation animation is finished , it throws exception because animation is trying to access deallocated mapview instance. So my quest...

iPhone: Same Rows Repeated in Each Section of Grouped UITableview

I have an app that is a list of tasks, like a to do list. The user configures the tasks and that goes to the SQLite db. The list is displayed in a tableview. The SQL table in question consists of a taskid int, groupname varchar, taskname varchar, lastcompleted datetime, nextdue datetime, weighting integer. I currently have it working ...

AdMob ad in iPhone app makes App content disappear when "done" is pressed!

Hello All, When I return from an adMob ad by hitting "done" the content of my app has disappeared ! All that remains is a background image I had attached directly to the main window. Oddly I can still hear the result of my touch events from my main screen (which is now gone). This may be related to the issue some people have had re...

iPhone app crashes with no justifiable reason ?

Hi all, I am developing an app in which I have a table. In the table cell I have an imageview ( the images are displayed via url ) and a textview/webview. I start threads for each row to get the images in the - (UITableViewCell *)tableView:(UITableView *)theTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath method ( if image ...

iPhone - how to pass an object to a button action

I have to pass an object to an button's action... something like [myButton addTarget:self action:@selector(sendIt:MY_OBJECT) forControlEvents:UIControlEventTouchDown]; I cannot set a variable and use that on the method because I am on a static class. How do I do that? thanks for any help. ...

iPhone 3.0 SDK replacement for initWithFrame:reuseIdentifier: help

I've been asked to edit some code for an app created in a previous iPhone SDK. Whilst I'm aware the is deprecated in 3.0, I can't seem to get it working. here is the code snippet I need to change, any suggestions? - (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier { if (self = [super initWithFrame:frame reus...

Change NSNumber value by allocating new NSNumber?

I understand that NSNumber is immutable, but I still have the need to change it in my app. I use it because it's an object, and therefore usable with @property (if I could, I would use float or CGFloat in a heartbeat, but sadly, I can't). Is there any way to just overwrite the old NSNumber instance? I'm trying this: NSNumber *zero = [[...

Can you get the current user's phone # and contact details through the iPhone SDK?

As far as I can tell, I can only get the entire address book, but there is no way to know which (if any) contact is the contact information for the owner of the phone, i.e. the phone # of the phone itself. Is there any way to accomplish this? Perhaps by triangulating some data the SDK makes available? ...

Help with iphone button pressed

I am trying to see which button was clicked on so I can preform the correct logic. This is the code for the buttons: UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(270, 423, 60, 60)]; [button addTarget:self action:@selector(buttonPressedAction:) forControlEvents:UIControlEventTouchUpInside]; [button setBackgroundIma...

UINavigationController override the way the view animates going back to the previous view

I have an application that has a UINavigationController that drills down to a view that looks like a card. I have on the card view a right button on the navigation bar which, when pressed, flips the view with a UIViewAnimationTransitionFlipFromRight animation to reveal the sudo back of the card. This is great and works well but when I pr...

IPhone XCode programming: view called from a navigation view doesn't set its IBOutlet attributes

I created a view Called ProgrammaView that appears when a row of a table is clicked. This view has a UILabel, a UIImageView and a UITextView. Now. ProgrammaView's Outlets have to be changed by the parameter passed to a method of the view called iniz. in this image there is first the ProgrammaView.h and then the method iniz. The prob...

iphone - getting the button id in a segmented control

I am trying to create something that uses the idea of the UIPopOverController, I mean, have that speech bubble anchor pointing to the button who triggered the method. The problem is that I am using a UISegmentedControl... How do I get the id of the button that was tapped on a UISegmentedControl, so I can determine its position and gene...

Why does my UIActivityIndicatorView only display once?

I'm developing an iPhone app that features a tab-bar based navigation with five tabs. Each tab contains a UITableView whose data is retrieved remotely. Ideally, I would like to use a single UIActivityIndicatorView (a subview of the window) that is started/stopped during this remote retrieval - once per tab. Here's how I set up the spi...

a "+" sign in email address

Hi. I need to submit an email address with a "+" sign and validate in on server. But server receives email like "[email protected]" as "aaa [email protected]". I send all data as POST request with following code NSURL* url = [NSURL URLWithString:[NSString stringWithFormat:@"%@%@", url, @"/signUp"]]; NSString *post = [NSString stringWithFo...

how to run countdown with dates to count days in iphone sdk

hi i need to countdown dates not times how to run countdown with dates to count days in iphone sdk ...

Subclassing NSObject, can it cause problems?

I have a very basic data class that is subclassed from NSObject. I declare a few strings, make sure they have properties (nonatomic, copy), and synthesize them. The only method I implemented was dealloc() which releases my strings. Can any memory problems arise from just this? Are there any other methods I need to implement? ...

Freehand drawing with Quartz 2D

I am trying to develop a simple freehand-drawing app for red-marking some of my images. Below is a method that is called from within the drawRect. I want to ask if there is a way to avoid adding the path every time before the path is redrawn? Also, the way the draw method is set up, the drawing gets a bit slow and choppy after a few se...