iphone

sqlite3_enable_shared_cache and sqlite_backup_init slowing execution on iPhone

I have some relatively complex sqlite queries running in my iPhone app, and some are taking way too much time (upwards of 15 seconds). There are only 430 or so records in the database. One thing I've noticed is that opening a new database connection (which I only do once) and stepping through query results (with sqlite3_step()) causes sq...

Is there an easy way to iterate over an NSArray backwards?

I've got an NSArray and have to iterate over it in a special case backwards, so that I first look at the last element. It's for performance reasons: If the last one just makes no sense, all previous ones can be ignored. So I'd like to break the loop. But that won't work if I iterate forward from 0 to n. I need to go from n to 0. Maybe th...

[super viewDidLoad] convention

I see some example code with [super viewDidLoad] called before your implementation and after your implementation. I know you don't always have to call super (as seen in many other discussions). When you do call it, is it expected before or after you code? This could have consequences depending on what super's implementation does. Thou...

Updating UIWebView off screen?

I'm trying to get a UIImage of a UIWebView, I can do this fine using renderInContext:. However before I generate the image I would like to update the UIWebView with some HTML code, the trick is the UIWebView is hidden. Right now, I can not get the updated version of the web view to render in the UIImage, just the old one. ...

UIImageView and UIImage: How can I tweak the most performance out of them?

First: I've implement a fairly complex scrolling mechanism for images, that allows to scroll over a few hundred thousands (theoretically) in one single scroll view. This is done by preloading small portions upon scrolling, while re-using all UIImageViews. Currently all I do is to assign new created UIImage objects to those re-used UIImag...

How do I upload custom images to my tab bar in the iPhone SDK?

How do I upload custom images to my tab bar in the iPhone SDK? I uploaded an image, added it to resources, and tried to make it the image for a tabbar item. This is what happened: http://www.mediafire.com/download.php?tmn1xtnmjhz Thanks ...

how to display an image in the navigation bar of an iPhone application?

how to display an image in the navigation bar of an iPhone application? (say, right after the title) ...

XCode 3.1.3 breaks console output

Hello, Today has been a headache - first my upgrade to xcode 3.1.3 trashed all my certs/provisions. After two attempts, I got them fixed. Now, I'm dealing with the issue in the subject, no console output. Absolutlely nothing is getting printed to the console - No startup info, not when I "print" a variable from xcode when stopped on a ...

How to handle Objective-C protocols that contain properties?

I've seen usage of Objective-C protocols get used in a fashion such as the following: @protocol MyProtocol <NSObject> @required @property (readonly) NSString *title; @optional - (void) someMethod; @end I've seen this format used instead of writing a concrete superclass that subclasses extend. The question is, if you conform to th...

Make Background of UIView a Gradient Without Sub Classing

Is there a way to make the background of a UIView a gradient without subclassing it? I'd rather not use an image file to accomplish this either. It just seems obtuse to have to subclass UIView just to draw a gradient for the background. ...

Creating a custom text-drawing view

Hi, I am creating a syntax highlighter for the iPhone and in order to display text with multiple formats, I have sub-classed UIView and modified the drawRect: method so that each line is displayed with the proper syntax highlighting (highlighting is done earlier with RegEx, text is drawn with CGContextShowTextAtPoint() one line at a tim...

Call UIViewController from "subview"

Hello, I have a UIViewController which when it loads it loads up this.. MapViewController *mapController = [[MapViewController alloc] initWithNibName:@"MapView" bundle:nil]; self.mapViewController = mapController; [self.view insertSubview:mapController.view atIndex:0]; [mapController release]; I also have a switch views b...

UIPicker swipes not responding

Hi guys, UIPicker swipes where responding perfectly in the Iphone simulator with SDK 2.2, but i am now testing with a new version of the simulator, and swipes are not working. I went trough the documentation and i cant see any changes on the API. So im asumming that something is wrong and the SDK 2.2 is letting me get away with it. The ...

What (not yet existing) iPhone apps do developers wish to get more productive?

What (not yet existing) iPhone apps do developers wish to get more productive? Let's do some brainstorming ;-) ...

Obj-C syntax error on if statement... Why?

Hi! REAL newbie here to Objective C and Cocoa. I have this 'if statement' if (cardCount = 2) UIImage *image = [UIImage imageNamed: @"Card 2.png"]; This gives me "error: syntax error before '*' token" Why? The UIImage line works fine by itself. I'd appreciate a pointer to what I've done wrong. Thanks Paul ...

NSURLConnection do not launch

Hello experts! I'm trying to create a very simple app which connects to an URL and gets the contents of that URL, in this case a simple xml document. My problem is that that the request never seems to gets sent. I have created a new project(Foundation tool) which runs from a main file. I have set the delegate of the NSURLConnection to...

Overlaying a UIImage with a color?

I'm attempting to add a black overlay over some current UIImage's (which are white). I've been trying to use: [[UIColor blackColor] set]; [image drawAtPoint:CGPointMake(0, 0) blendMode:kCGBlendModeOverlay alpha:1.0]; But it's not working, and I'm pretty sure set isn't supposed to be there. ...

iphone shortdate with 4 digit year

I am sure I am just missing something. But I have googled this for days trying to find how to show a 4 digit year when displaying an NSDate with a style of NSDateFormatterShortStyle. Please let me know if you have a solution. Here is the code I am using now. [NSDateFormatter setDefaultFormatterBehavior:NSDateFormatterBehavior10_4]; ...

iPhone hide Navigation Bar only on first page

I have the code below that hides and shows the navigational bar. It is hidden when the first view loads and then hidden when the "children" get called. Trouble is that I cannot find the event/action to trigger it to hide again when they get back to the root view....I have a "test" button on the root page that manually does the action b...

Core Animation or OpenGL ES?

Hey, I want to do the following: Tap the screen and draw 3 cricles around the the tapped point. Is it better to do this with Core Animation or OpenGL ES? Where do I start? Regards ...