iphone

What's the most efficient way to create particles on the iPhone.

I'm looking to create a snowfall effect on the iPhone and I'm looking for advice as to how to best implement this. I've planned to use a png image as the sprite. ...

How do I debug with NSLog(@"Inside of the iPhone Simulator")?

I'm used to programming and having log messages be viewable. I know you used to be able to use NSLog() to trace out messages when debugging Cocoa apps. What is the best way to "trace" messages when coding in a iPhone XCode development environment? ...

Animate CGContextStrokeEllipseInRect

I'm trying to animate the drawing of a circle. Something the Shazaam app is doing while recording, but much simpler. I've got this code in the drawRect: method to draw the circle: CGContextRef currentContext = UIGraphicsGetCurrentContext(); CGContextSetRGBStrokeColor(currentContext, 0.86, 0.86, 0.86, 1.0); CGContextSetLineWidth(currentC...

UINavigationController on top of a modalView on the iPhone

I have a modal view controller that I put onto screen using presentModalViewController:animated. This particular view controller, an instance of UIViewController, has a UITableView and cells with further detailAccessory options. Clicking on a date row should allow a controller with UIDatePicker to populate on the screen. The problem is t...

iPhone UIWebView playing MP3. Dismissal protocol?

So I can't find any documentation on how to do this, maybe someone knows what's going on here. I'm in a UITableView (with a UINavigationController) in my application, and launching a UIWebView that loads an mp3 file on the internet by pushing the Web View's controller onto the navigation controller's stack. This works great, the file l...

extracting mp3 file duration using AudioQueueServices

I have implemented a streaming mp3 player using AudioQueueServices, that downloads mp3s over an NSURLConnection. Playback, pausing, and seeking work great, however I can't figure out how to extract the duration of the audio from the mp3 files while they are still being downloaded. I'd like to be able to pull the info from the id3 tags...

Why doesn't an iPhone app's main() function ever get a chance to finish?

Consider the following main() method which you would find most iPhone applications: int main(int argc, char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, nil, nil); [pool release]; return retVal; } In every iPhone app that I've run in Simulator with the...

Interface Builder vs. What's Displayed on iPhone

Hello and thanks for giving this question a gander. It seems that PNG files that I drag/drop into IB do not display in the same manner that they are shown in the iPhone simulator. What gives? For example, if I want to drop in a PNG with rounded corners, IB shows hard rectangular corners but when I build to the simulator, I see the roun...

what language are the apps for the iphone created with?

what language is it similar to? cause i was looking at the dev page on apple for the iphone and it doesnt look like anything that i'm used to or know. ...

Rotation affecting Navigation Bar unpredictably

Here is my setup: one navigation controller, two views The first view, the rootview, displays the statusbar and navigation bar (portrait view). When the rootviewController senses rotation, it hides the nav bar and status bar and then it pushes view 2 onto the navigation controller (in landscape now). This part works as expected. When ...

how i can navigate to another page from a button

hey, i am new at the area of objective c. i am building an iphone app by using xcode . i have taken two button on a page and from among one i would like to go to another page how is it possible at xcode? ...

"kCGColorSpaceGenericRGB" is deprecated on iPhone?

I'm trying to get bitmap context with the following code: GContextRef MyCreateBitmapContext (int pixelsWide, int pixelsHigh) { CGContextRef context = NULL; CGColorSpaceRef colorSpace; void * bitmapData; int bitmapByteCount; int bitmapBytesPerRow; bitma...

How to stop a UIButton on a "lower" view from being clicked when clicking at the same place on the image on "top"

I have UIButton on the main view, when the button is clicked I add a UIImageView to the whole screen filling up the screen (this is added on top of the button). What happens is that by clicking on the UIImageView's image (at the location where the UIButton is) it launches the UIButton click. However, since the button is invisible to th...

UITextView on a UIAlertView (multi-line input)

Hi, i'm having a couple of problems when i try to alloc a UITextView on an AlertView. Here is my code: UIAlertView* minhaCritica = [UIAlertView new]; minhaCritica.title = @"7Arte"; [minhaCritica addButtonWithTitle:@"Cancelar"]; [minhaCritica addButtonWithTitle:@"Enviar"]; minhaCritica.message = @"Escreve a tua crítica:\n\n\n\n"; minhaCr...

How to pull out the ARGB component from BitmapContext on iPhone?

I'm trying to get ARGB components from CGBitmapContext with the following codes: -(id) initWithImage: (UIImage*) image //create BitmapContext with UIImage and use 'pixelData' as the pointer { CGContextRef context = NULL; CGColorSpaceRef colorSpace; int bitmapByteCount; int bitmapBytesPe...

Custom iPhone camera controls (not using UIImagePickerController)

While I understand that in order for an iPhone application to be accepted on the App Store, one requirement is that only documented libraries are to be used. If this is the case, how are certain applications such as "Night Camera" and "Camera Plus" using a camera control that seems to be something other than the one contained within UII...

How to Change the Tab (of a UITabViewController) Programmatically?

I'm trying to programatically select/change the tab of the UITabViewController. I tried doing it via: self.tabBarController.selectedIndex = 2; This looks to be the way that I should do it, but it doesn't work. I thought that maybe the self.tabBarController returns a read only object (I sorta remember reading that somewhere), but I'm ...

Getting a segfault (EXC_BAD_ACCESS) when deallocating variables

Ok I understand that this error mostly comes from sending a method call or trying to access a variable that has already been deallocated. Here is the problem: .h @interface TimeEntry : NSObject <NSCopying, NSCoding> { NSDate *from; NSDate *to; NSString *information; } @property (nonatomic, retain) NSDate *from; @property (nonatomi...

How to properly develop for the iPhone on a PowerPC Mac?

I'm doing iPhone development on a PowerPC Mac. How do I get code signing to work properly so that I can build to my iPhone? The iPhone SDK doesn't officially support PowerPC, but with some fidgeting, it can be installed. See here. I've got the SDK installed and running fine in Xcode and the iPhone simulator works fine. However, I can't...

How to read CGBitmapContextData? (on iPhone)

I'm working on obtaining bitmap data like ARGB from an image. a). I create a bitmapcontext for the image: context = CGBitmapContextCreate(void * data, size_t width, size_t height, size_t bitsPerComponent, size_t bytesPerRow, CGColorSpaceRef colorspace, CGBitmapInfo bitmapInfo) b). I draw the image to the context: CGContextDrawImage...