iphone

Possible to "reset" a UIDatePicker's highlighted month/day/year?

I have a View Controller I'm reusing to edit individual objects (NSString, NSNumber, NSDate) in a previous View Controller's TableView. I'm loosely basing this off of the EditingViewController in Apple's SQLiteBooks sample project. the datePicker is instantiated in the nib file. The issue here is it works fine & dandy for the first dat...

how can I call a screen with a button action (xcode) ?

I am developing a Window Based app for iPhone. I use Interface Builder to build Interface. I want to call a new screen with a Button Action. How can I call the screen with Button action ? ...

two AlertView in same Viewcontroller

i have two Alertview in same viewcontroller and i want to use the delegate method -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger) buttonIndex this method will get called when button in alertview been pressed however both alertview will call the same method how can i different the two alertView? ...

What's the best way to communicate between view controllers?

Hi Stack Overflow Gang, Being new to objective-c, cocoa, and iPhone dev in general, I have a strong desire to get the most out of the language and the frameworks. One of the resources I'm using is Stanford's CS193P class notes that they have left on the web. It includes lecture notes, assignments and sample code, and since the course ...

Retriving the retain count for a CGImageRef object?

While you can release a reference to a CGImageRef object using "CGImageRelease", which, according to the SDK this "decrements the retain count of a bitmap image", is there a way to inspect the current retain count for a CGImageRef instance? [cgImageRef retainCount] isn't valid since CGImageRef isn't a valid receiver of the retainCount m...

Recording sound as WAV on iphone

I am making an iPhone recording app that needs to submit the sound file as a .wav to an external server. Starting from the SpeakHere example, I am able to record sound as a file, but only as .caf Does anyone know how to record it as a wav instead? Or how to convert from .caf to .wav on the iphone? (The conversion must happen on the pho...

Changing Tint / Background color of UITabBar

The UINavigationBar and UISearchBar both have a tintColor property that allows you to change the tint color (surprising, I know) of both of those items. I want to do the same thing to the UITabBar in my application, but have found now way to change it from the default black color. Any ideas? ...

Copying UITableViewCell

I'm reading a custom table cell in tableView:cellForRowAtIndexPath: from a nib file. This works great for my purposes, except it's quite slow. Now, I know the right thing to do in the long term is to create the cell entirely in code, and to use a single view, and so on. But this is a prototype, and I don't want to put that much effort i...

CALayer addSublayer increasing retain count?

I think that when I add a view as a subview like such: UIView* view = [[UIView alloc] init]; [self addSubview:view]; [view release]; that it's safe to release the view afterwards...is it the same for a CALayer object? If I create a CALayer using alloc/init, and do: [self.layer addSublayer:layer]; is it safe to do a release of the l...

NSDate and NSDateFormatter issues

I'm having slight difficult understanding why the following code is crashing an app of mine: NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"MMMM d, yyyy"]; NSDate *date = [dateFormatter dateFromString:cDate]; datePicker.date = date; NSString *dateStr = [dateFormatter stringFromDate:date];...

playing frequencies on the iPhone

Can someone help me use the AudioQueue services on the iPhone to play a certain frequency (say, 440 Hz)? I've looked at the documentation, but I can't seem to figure out quite how to do it. Apple's sample code also isn't helping me too much. Thanks! ...

Cocoa: Can I purposely block in a loop to wait for an asynchronous callback to finish?

Apologies in advanced for my confusion. I'm trying to do a batch upload of photos in my iPhone application. I have one script that's looping through a user's photos, and then for each photo, calls another script to do the upload. The script that does the upload needs to call back the script that's firing off each of the user's photos to...

get current system volume level on iPhone

Is there a way I can get the current system volume level on the iPhone? I'm thinking maybe there's a way to make an MPVolumeView and get the value from that. ...

How Do I do Real Time Sound/Signal Processing On The iPhone?

Hi, I may be doing an iPhone-based application doing near-real-time sound-processing (filtering, etc). I was wondering the best way to get started. Would I want to create an audio cue for recording and processing sound, as described here? Edit: I should be clear. I am not asking how to do signal processing, in general. I know some of...

Memory management. Copy method

I use this code to copy and instance of my class //Create the copy and pass it onto edit controller PoolFacility *poolCopy = [self.thePoolFacility copy]; self.childController.thePoolFacilityCopy = poolCopy; [poolCopy release]; Now when I view the variables in the debugger, how come some of the class' fields have the same memory addres...

How to get touch event on a CALayer?

ok - I'm new to the iPhone SDK. Right now I'm programming with CALayers which I really like a lot- not as expensive as UIViews, and a lot less code than OpenGL ES sprites. I have this question- is it possible to get a touch event on a CALayer? I understand how to get a touch event on a UIView with -(void)touchesBegan:(NSSet *)touches...

Getting started with Server applications

I have an iPhone game (Combination), and in the next version I would like to set up a server, where users (via the app) can submit which levels they have completed, and see how other users are doing. At this point I don't intend that users will need usernames and passwords, just a simple submit data, get back data. I know very little ab...

Truly modal UIAlertView in iPhone?

I'm need run a couple of validatins that depend on the decisions of the user (for example, if aprove a purchase above the spending limit), and deny the "done" action if it's fail. However, look like is not possible have a truly modal action like with other languajes (like showmessage, alert(), etc) and everything is by delegates. But t...

A shot in the dark - Application bug

Ok so this is gonna be a bit of a shot in the dark without you being able to see my application! I have a bug. I have a SwimmingPool class, my app passes the pool from a tableview into a detail view where you can see all the swimmingPool class fields. You can then click on the individual detail, edit it, and then save it. The 'original'...

iPhone SDK: what is the difference between loadView and viewDidLoad?

When working with views and view controllers in an iPhone app, can anyone explain the difference between loadView and viewDidLoad? My personal context, is that I build all my views from code, I do not and will not use Interface Builder, should that make any difference. I've found that often when I add init code to loadView, I end up ...