ios

Seeing malloc allocating large chunks of memory - trying to track down why (iPhone)

I'm seeing my app being killed by iOS with an out of memory message, however, while tracing the progress of the app in the Allocations Instrument, I see lots of mallocs that seem to be occurring outside of the code I've written. I'm not seeing any leaks being caught, so I assume these allocations are supposed to be there. Thing is, beca...

iOS 4: FigCreateCGImageFromJPEG returned -1

I'm trying to get a basic image picker/photo taker running in my app and have run into the following error: *** ERROR: FigCreateCGImageFromJPEG returned -1. Input (null) was 551120 bytes I have the image picker showing, the camera view works fine. When I take an image with the camera and select the 'use' button the error appears in...

Apple iPad HIG?

Is it against Apple Human Interface Guidelines to make an iPad app that does not rotate to different orientations, if it is intended for kiosk mode operation? ...

Animate the resizing of a UIWebView

Hi everyone. I'm having a really hard time trying to animate the resizing of a UIWebView, and just don't know where else to go. Here's what I want to accomplish: I have two views, one above the other (imagine two squares, one on the top of the other). The top view is a UIWebView, and the bottom one will be referred to as a general UIVi...

"Operation couldn't be completed. Connection reset by peer." with NSURLConnection on iOS

Hello. I'm struggling sending POST data to a server and receiving the correct response. I started by using setHTTPBody but moved to setHTTPBodyStream when I wasn't getting the correct server response for certain POST data and I read setHTTPBody has a memory leak on earlier iOS versions. The problem is setHTTPBodyStream causes the error -...

Why use "viewWithTag" with "dequeueReusableCellWithIdentifier"?

Hi, can someone please explain why you should use "viewWithTag" to get subviews (e.g. UILabel etc) from a cell in "dequeueReusableCellWithIdentifier"? Some background info: I've got a custom UITableViewCell with a couple of UILabels in it (I've reproduced a simple version of this below). These labels are defined in the associated NIB fi...

How to handle class methods being called again before they are finished?

Hi. What is the best way to handle this situation on an iPhone device: My program ramps the pitch of a sound between two values. A button pressed calls a method that has a while loop that does the ramping in small increments. It will take some time to finish. In the meantime the user has pressed another button calling the same method. No...

iOS CALayer.mask on a moving layer.

Hi everyone, I'm writing an iOS app and I have set up some code for a CALayer named "Wheel" to animate (rotate) continuously which works great. I wish to mask this layer so only a small portion of it is visible, instead of the whole layer. I added a mask using CALayer.mask but it too rotates as it's a sublayer of "Wheel". Is there any ...

Is this the best way to draw large images to a UIView?

The app I'm working on requires me to draw images to a UIView. These images are large (some are 1024x768), and I'd like to be sure my drawing code isn't sub-optimal. My drawRect method in my UIView looks like this: - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextClearRect(context, rect)...

intermittent "No Route to Host" on iOS, flight mode off then on fixes

Hi all, My iPhone app uses UDP to communicate over the cell network. It generally works, except that sometimes the operating system returns "No route to host" (65) on a sendto call, and it never works from that point onwards -- I just keep getting same error, even if I close and reopen the app. However, if I toggle flight mode (presum...

Supporting both high-res and low-res images

What is the best pattern for displaying images both on iOS3 and iOS4? For example, here's code for a custom activity animation: activityImageView.animationImages = [NSArray arrayWithObjects: [UIImage imageNamed:@"s01"], [UIImage imageNamed:@"s02"], [UIImage imageNamed:@"s03"], [UIImage imageNamed:@"s04"], [UIImage imageNamed:...

Getting started with cocoa for os x?

I am familiar with iOS programming, but I don't know where to put my logic when I start a Cocoa project for OS X. Are there any good online resources for transitioning to OS X from iOS? EDIT: Thanks for the help so far. My main question is where my code goes in the default template. ...

Deadlocks: How do you determine if a call may cause unsafe painting off of the main thread for iOS?

Drawing/painting should always be done on the GUI thread otherwise deadlocks can occur!... How do you determine if a call may cause unsafe painting off of the main thread for iOS? The problem is we get stacks like this which are not on the main thread... #19 0x02a788d2 in -[CALayer drawInContext:] #20 0x02a784b0 in backing_callback #2...

How to distory the view that added by pushViewController?

Hi, After adding a view by pushViewController method, there will be a back button in the navigation bar to pop out the view. However, seems that iOS won't distory the view after popping it out. When will it be distory? Can we distory it manually when popping out the view? thanks. ...

What's an easy way to manage source files that are shared among different Xcode projects?

Hello. I'm diving into iOS development and I plan to build a few basic apps that make use of my own reusable code. As I update the files that contain my reusable code, I'd like those updates to be reflected in all the Xcode projects that use them. What are some ways I can do this? Thanks in advance for your help! ...

Open Source library or simple method to detect iPhone 'bumping'?

I know that there is an iPhone app which lets you bump your phones together (called 'Bump' of course), but is there an open source library that allows you to connect to another phone upon 'bumping' phones...? Is is there an existing iOS API(s) which would allow this? ...

Where can I find and change the setting that specifies the name of the iOS application?

Hello. I've created an iPhone app project in Xcode and I'd like to change the name that is displayed under the app icon, as well as in alerts, etc. By default, the name of the app is the same as the name of the project. How can I change the name of my iOS app? Thanks in advance for your help! ...

Framework for iPhone / iOS asynchronous multiplayer gaming?

I'm curious if anyone knows of any frameworks that enable asynchronous multiplayer gaming in iOS? I know GameKit/Game Center eases synchronous (realtime) multiplayer gaming - I'm thinking of something more like Words With Friends. There would obviously need to be a server-side element that I'd have to provide, to store game state and s...

Always on top html block for iPhone

How can I create a DIV block that always stays at the bottom of my page? When scrolling more content should show up right above the block. The only solution i can think of is to use 2 iframes but I prefer using CSS. Update: The solution needs to work on iOS ...

Drawing view on iOS

How can I implement a view for users to draw in (specifically sign their name)? I would greatly prefer a library or sample code to implementing it myself. Thanks ...