iphone

XCode copies blank database when doing build...

I've noticed that even though I placed my sqlite3 database in the "resources" folder, and even though I checked the "Copy file" box, when I do a build, XCode creates an empty database toi the application folder it's building...so it's FINDING the database, and OPENING it, but there's nothing IN it, so when I do a sqlite3_prepare_v2, I g...

NSInvocationOperation Memory Problems on iPhone

Hi, I've been experiencing memory problems (the app will run for a couple of iterations, then receive low memory warning and finally be terminated) while working with NSInvocationOperation in a method called repeatedly by a NSTimer. The method will be called every 1/4 of a second and I've narrowed down the source of the problem to the ...

Is there a way to retrieve every responder that has handled a UITouch?

I'm trying to debug some touchesBegan/Moved/Ended related slowdown in my game; I think that some of my touch responders are not unloading properly, and so as the game runs on more and more of them stack up and the touches get less responsive because they have to pass through a larger and larger responder chain. Is there some way to vi...

OpenGL ES as a 2D Platform

I've seen a lot of bandying about what's better, Quartz or OpenGL ES for 2D gaming. Neverminding libraries like Cocos2D, I'm curious if anyone can point to resources that teach using OpenGL ES as a 2D platform. I mean, are we really stating that learning 3D programming is worth a slight speed increase...or can it be learned from a 2D p...

iPhone pushNotification DeviceToken - How to "decrypt"

I've already managed to get the devicetoken from APNs. It's type of NSData. So i want to write this deviectoken into my mysql db. I've already tried to convert it to a string without luck. That was my way: NSString *tokenTMP = [[NSString alloc] initWithData:devToken encoding:NSASCIIStringEncoding]; If i have the deviceToken in a rea...

How can I determine if iPhone is set for 12 hour or 24 hour time display?

I thought I saw something answering this on SO recently but now I can't find it. Here is the code I am using now to determine if settings are for 24 hour time display. It works for me in the US, but I don't know if it will work in all locales. Is this sufficient or is there a better way to find out the current setting for this? +(BOO...

iPhone App not saving values to .plist file

Hey everyone. I am working on an app that displays a modal the first time the consumer uses it. I have a .plist file that will store the information I request once the Save button is pressed. I can read from the .plist file fine and when I run my save method it SEEMS to work fine but the .plist file is not updating. I'm not so sure of th...

How to remove the last UITableViewCell

Hi, I am trying to remove a the last uitablviewcell from a uitableview, but I am having some trouble. The code I have so far is. [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:[self.tableView numberOfRowsInSection:0]] withRowAnimation:NO]; Which I thought would remove the last cell? Any suggestions? Thanks. ...

How can I override a getter on a propery when using Core Data?

I want to be able to override the getter on a string property on one of my core data models and inside the getter I need to find out what the value is for that property. @interface LabTest : NSManagedObject { } @property (nonatomic, retain) NSString *status; @end @implementation LabTest @dynamic status; - (NSString *)status { NSS...

UIDatePicker graphical glitch

I'm experiencing a bad looking graphical glitch with UIDatePicker, and I'm wondering if anyone else has seen and/or resolved it. It is something non-deterministic, because every once in a while it goes away and looks normal. Check out the highlight and shadow bars are shifted... I have tried removing all other graphical elements. I...

String identifies iVar to update

I have a series of 5 iVars. (highscore01, highscore02, highScore03, highScore04, highScore05) I want to update a particular iVar with an integer value. The iVars are defined as ints. The iVars are in a Class called HighScores. The particular iVar to be updated is the one with the lowest current value stored in it. I want to replace the ...

NSZombie on a distributed application

Is there any danger in compiling an application for distribution with NSZombie still enabled? I generally leave it turned on for all of my apps while developing because of how useful it is, but I don't understand the full ramifications and potential issues related to enabling it and leaving it on indefinitely. Thanks! ...

What tool or technology does Apple use to create its documentation?

I am sure they use something really fancy to create their documentations and guides. Everything is so streamlined and equal, and they always have a HTML and a PDF version. Now we make a big framework and want to provide a good documentation that's set up the way Apple does it. Online in HTML format and offline in PDF. Any idea how the A...

What is the best "how to" site to learn how to program for iPhone?

What is the best "how to" site to learn how to program for iPhone? ...

iPhone app crashing with objc_msgSend when combining pushViewController and presentModalViewController

Hi all Here's the scenario: On my iPhone app (OS 3.1.2), I've got "view 1" which navigates to "view 2" using a pushViewController call. Then, on "view 2", the user can optionally call "view 3", which is displayed using presentModalViewController and an animation (flip horizontal transition). I can switch view 1 <-> view 2 back and forth...

Encoding issue: Cocoa Error 261?

So I'm fetching a JSON string from a php script in my iPhone app using: NSURL *baseURL = [NSURL URLWithString:@"test.php"]; NSError *encodeError = [[NSError alloc] init]; NSString *jsonString = [NSString stringWithContentsOfURL:baseURL encoding:NSUTF8StringEncoding error:&encodeError]; NSLog(@"Error: %@", [encodeError localizedDescripti...

iPhone, is it possible to play a sound from the speakers while in a call?

I would like to know from some iphone-Audio expert if there is a way to let a sound play through the line in of the microphone, or at least to play from the speaker (not the receiver) during a call. I've tried different combinations of AVAudioSessionCategory with kAudioSessionProperty_OverrideAudioRoute, but I've noticed that when the i...

resignFirstResponder

Hi, I have a litle problem resigning the keyboard. I have a table with two sections. In the second section, I load the class "stationenStartCellNumber" which has a UITextField. When I press anywhere outside of the UITextField, I want the keyboard to resign as first responder, and thereby closing the keyboard. It works perfectly inside...

conditional implementations of methods.

ok.. think of objectA.. objectA has optional properties defined in its protocol. the delegate may or may not implement these, but if you do decide to implement them, you must provide a valid return. now what if i have objectA.delegate set to objectB but object be needs to implement them all at compile time, and at runtime will decide wh...

Create a porthole animation transition on the iPhone?

Can anyone recommend how I might be able to create a view transition that looks like a circle expanding from the center of the view? Any pointers would be helpful, or maybe a link to some similar code, even in a different language. ...