iphone

How to tell the difference between an iframe loading vs. entire page loading in a UIWebView?

In the [webView:shouldStartLoadWithRequest:navigationType:] event, how can you tell the difference between an iframe that's loading content vs. the entire page loading content? It seems like the both call this same event with the same arguments, the only difference being the URL that's going to be loaded, so there is no way to tell the d...

how can i write a context to draw a multiple pages PDF in iphone ?

hi i am drawing a pdf by the following code CGContextRef pdfContext; CFStringRef path; CFURLRef url; CFMutableDictionaryRef myDictionary = NULL; // Create a CFString from the filename we provide to this method when we call it path = CFStringCreateWithCString (NULL, filename, kCFStringEncodingUTF8); // Create a CFURL using...

Navigation and Tabbar Controller in same window?

So pre3.0 I tried to do a navigation and tabbar controller in the same window and I had a problem with pushing a view onto the navigation stack. I'm sure so e of you know of this problem. What is the solution? ...

% operator for time calculation

I am trying to display minutes and seconds based on a number of seconds. I have: float seconds = 200; float mins = seconds / 60.0; float sec = mins % 60.0; [timeIndexLabel setText:[NSString stringWithFormat:@"%.2f , %.2f", mins,seconds]]; But I get an error: invalid operands of types 'float' and 'double' to binary 'operator%' And...

Upgrade to iPhone 3.0 sdk and now simulator shows blank screen.

I have an iPhone app that uses an UITabBarController, which contains two UINavigationControllers, each of which in turn contains one or more TableViewControllers (actually, customized UIViewControllers implementing UITableViewDelegate and UITableViewDataSource. ) On launch, it displays the UITabBarController with one of the tableviews di...

Tips for converting an iPhone 2.x app to 3.0 with Core Data

I have an app developed for iPhone OS 2.x. For the obvious reasons, the model classes in that app were written without Core Data. Now that 3.x is available, I'd like to know what are some of my options for taking my existing model classes and rebuilding them with Core Data. I do many things with my models besides the obvious, such as s...

iPhone detecting touches on a map image

Hi, I have a static map image with a bunch of circles and squares on it that depict cities. I have loaded the image into an imageView that is sub-classed under a scrollView so that I can capture user touches and zoom/scroll across the map. My challenge is that I want to pop-up a label whenever a user touches one of these circles/squar...

Objective C release, autorelease, and data types

I'm new to memory managed code but I get the idea pretty well. On taking my app through the leaks tool in XCode, I noticed I only had to clean up my custom objects, but not dynamically created arrays for example, so I figured those data types are autoreleased - makes sense since I only had to release the arrays I used as properties that...

memory leaks in Instruments

I'm getting lots of leaks in my code, but none of the leaks point to any of my code (they are all UIKit methods). I'm running 3.0. Could someone tell me how I go about figuring out where these leaks are coming from? ...

Set switch On/Off in cell (2.2.1 to 3.0 bug)

I'm working on upgrading my app to 3.0, and a new bug has developed that didn't exist in 2.2.1 (in fact this is the only problem I had by upgrading... other than a setText: is depreciated warning) I have a tableView with cells which have switch controls on them. With the viewWillAppear, I am setting these switches based of values read ...

iPhone: Cannot find resource

Hi, In my app I want to copy a file from my bundle to documents directory in order to modify it. Here's my code: +(BOOL) copyDB: (NSString*) pdbName { NSFileManager *fileManager = [NSFileManager defaultManager]; NSError *error; NSString *dbPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, ...

Listening to the iPhone mic with SCListener and playing music at the same time: how?

Hello, I am using Stephen Celis' SCListener class (for iPhone) to "listen" from the microphone, but I also need to be playing music at the same time using the MediaPlayer framework. However, when I start listening with SCListener, the music fades out and stops. I have set the kAudioSessionCategory_PlayAndRecord property on the audio se...

How to add a right button to a UINavigationController?

I am trying to add a refresh button to the top bar of a navigation controller with no success. Here is the header: @interface PropertyViewController : UINavigationController { } Here is how I am trying to add it: - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { if (self = [super initWithNibName...

UIButton and setImage: not working consistently - inconsistent

I have a UIButton on a UIView. I want to programatically figure out which image to display inside the button when the view is displayed. I have overriden the drawRect method in the UIView and used a setImage to display the desired image. However, when the view displays, sometimes it draws the desired image, and sometimes it does not. I h...

How do I remove spaces in UIToolbar between custom views?

I'm trying to create a UIToolbar with 5 buttons using custom images. The way I'm doing this is by creating buttons of type UIButtonTypeCustom, then creating UIBarButtonItems from these, then adding these to the toolbar with setItems:animated:. However, this adds spaces between the images which cause the 5th image to end up half off the r...

iPhone Dev - keeping interface rotation

(Just so you know ,I'm learning to develop for iPhone without Interface Builder) I have an app with a root view controller, a blue view controller and yellow view controller. The root VC lazy-loads the blue and yellow VC's and displays the blue VC's view first, and then switches to the other one when a button in the toolbar at the bottom...

How to tell a message sent to the MPMediaPlayer has timed out?

I've been working with the MPMediaPlayer framework for the 3.0 SDK. Sometimes the Media Player is slow to respond, or doesn't respond at all. I get warning messages in the console, but the user will never see these messages (and thus blame my app for the timeouts). Is there a way to recover from these timeouts? Can I set things to NOT ...

UIScrollView horizontal paging like Mobile Safari tabs

Mobile Safari allows you to switch pages by entering a sort of UIScrollView horizontal paging view with a page control at the bottom. I am trying to replicate this particular behavior where a horizontally scrollable UIScrollView shows some of the next view's content. The Apple provided example: PageControl shows how to use a UIScrollVi...

Adding attribute to entity in Core Data

I've created all of my Managed Objects after mapping out all entities/attributes/relationships in the data model. Now I have the problem of needing to add additional attributes/relationships I haven't thought of when I first designed one of my entities/classes. Is there a way to modify my existing NSManagedObject class with Core Data sho...

Loading form input values from web pages into URLRequest?

How would I pull out the form values for the html source below and add them to an NSURLConnection? <tr> <th><label for="username"><span class="accesskey">N</span>etID:</label></th> <td><input id="username" name="username" class="required" tabindex="1" accesskey="n" type="text" value="" size="32" autocomplete="false"/...