iphone

JSON parsing error

I am trying to parse some JSON. I've passed a constant key value and a string - butI'm receivng 16 objects in the statuses array and 20 objects in ststuses1. Are any of the parsing steps wrong? I have included the code for the JSON parser. Thanks in advance. SBJSON *parser = [[SBJSON alloc] init]; NSString *urlString =[NSString str...

Proper use of UIImagePickerController for both taking pictures with camera or selecting them from the iphone library

Hey. What I want to do is to always use the same instance of UIImagePickerController in my whole app, since i don't want to alloc and destroy my picker every time the user takes a picture. The app uses a picker and an UIImageView named pictureA to show the picture choossen from the iPhone album or taken with the camera. At start I all...

UIView animated crossfade causes alpha to drop below 1.0?

I'm crossfading between two views using UIView animation. I've noticed the following surprising fact: If I have (say) two identical views in an identical place, and I animate a cross fade between them (e.g. animate the alpha from 0.0 to 1.0 on one while going from 1.0 to 0.0 on the other, in the same animation), during the animation, th...

PAK archives and zlib (zlib.dylib)

Hi All, I'm currently writing an iPhone app where I need to uncompress several files from .pak archive. I'm assuming libz.dylib will probably have the ability to do this but I'm having a hard time find any code on the subject. Anyone got any example code or can point me in the right direction? Any help at all would be much appreciated...

iphone 4 higher resolution pics vs 3gs

Hi, i just have a 3gs for testing (here in romania i still cant get a iphone 4) When I just create full screen images for iPhone 4 .. would they be displayed resized on the 3gs? I just cant make a bundle version for 3gs and 4 with 2 times my images, they are already a lot. Do I have to make now 2 Apps ?? Could this be a trick: In my x...

Why does MPMoviePlayerController work in the simulator, but not the device?

Hey guys, I'm having trouble getting MPMoviePlayerController to work on the device. It runs fine in simulator, playing a five-second video and then sending the appropriate callback (myMovieFinishedCallback:) to the view controller. When it runs on the device, the movie never shows up, even though I can trace through [player play] with n...

How can I check if there is enough memory to process a picture captured by UIImagePickerController when taking multiple pics with the camera?

I am writing an application that uses UIImagePickerController to take multiple pictures with the camera as fast as iOS allows. My application has to run on iOS 3.13 on all versions of iPhone hardware (v1 through 4). I am using UIImagePickerController with a cameraOverlayView. My question is, how can I determine programmatically how man...

Is there a way to use a custom selected image for UITabBarItem?

I like to have a custom selected image when a user selects an item on the tab bar, by default it selects as blue like but would like to have a green color instead. something like below any thoughts? ...

UIImageView frame memory issue

I am setting the frame property of a UIImageView at a frequency of about 30Hz. Instruments shows that QuartsCore is allocating (and releasing) 88 bytes at this frequency. The following code causes this issue. CGPoint point = vectorToCircle(vec) ; CGRect dotFrame = self.dot.frame ; dotFrame.origin.y = (center.y - kDotHalfHeight) - point...

Why doesn't Xcode 3.2.3 stop debugging my application when I hit home in the Simulator?

Good Day! i have installed xcode latest in my snow leopard, now i have a question that when i run my project in xcode, and then stop it from simulator, but the xcode still shows that the app is running. so if i have to run it again, it will ask to rebuild like it was running and i want to run it again. i want to know that whether its an...

Monetizing iPhone Apps for 16-year-old developer?

Hey all, I'm getting tired of creating free apps that are of a high quality, but they don't do much for me. I looked into selling paid apps and iAds, but they both require the intervention of the tax man, who I really don't want to get into trouble with. What is the best thing I can do, as a 16-year-old developer, to monetize my iPhone...

Optimize memory consumption when gradually writing to a file

Hi! I've been doing some tests, and one of my needs is to read data from different xml files and stack it together on a single file. While I've managed to accomplish this, memory consumption seems to be quite large for the task, the iphone simulator didn't even raise the memory warning, but I don't think the real iPhone would tolerate th...

If I add a UISwitch control to each of my table view cells, how can I tell which cell it belongs to?

Hi. I have a UITableView with cells that contain a UISwitch control. It's similar to the table view in the iPhone's Clock app shown below... In my app's cellForRowAtIndexPath method, I create and attach the UISwitch control like so... CGRect frameSwitch = CGRectMake(215.0, 10.0, 94.0, 27.0); UISwitch *switchEnabled = [[UISwitch a...

Accessing UIView methods

Howdy, I have a UIViewController that contains a UITabBarController, which contains a UIViewController, e.g.: UIViewController1 -> UITabBarController -> UIViewController2 I want to hook up a button in UIViewController2 that will call a method in UIViewController1, but how do I access UIViewController1 from UIViewController2? I know ...

sorting table view items

are there any buildin tools to sorting cells in a tableview by content title etc ? ...

How to display List of images in two columns and number of rows

Hi all, In my project i have list of images i have to display them in two columns and number of rows How can i do this can any one help me out. Thank you ...

Is NSURL supposed to parse invalid URLs?

I could not really find this in the documentation ... I'm writing some unit tests and one of the tests that is supposed to fail is [NSURL URLWithString: @"cow"]. Because cow is not a valid URL. However, it is happily parsed by NSURL with no errors at all. It does not return nil and it does not throw an exception. Calling [url absoluteS...

EXEC_BAD_ACCESS with cellForRowAtIndexPath, again...

Hi everyone, i've another problem with the UITableView, app crashes after reloading tableView after loading data from internet, the crash happens in marked place in cellForRowAtIndexPath methood. I thinnk i still don't fully understand what actually mean recycling cells. Thanks for any help - (UITableViewCell *)tableView:(UITableView *...

NSString and retainCount question

I have a NSString declared in the interface part: @property (nonatomic, retain) NSString *filePath; In viewDidLoad I give this a value and when I am trying to call it from one of my custom methods it works for the first time but on the second it crushes. In my opinion filePath was autoreleased during the first call. I tried a diff...

How to Draw with your Finger on an iPhone Web App HTML5 - Is it possible?

As a webapp, not a native app on the iPhone or Andriod. Is it possible to draw with your finger? If so, how? Anyone have or can provide a barebone simple example that just loads a blank page? Thanks ...