iphone

Using SQLite3 on iPhone to get midnight (this morning) as a UNIX timestamp

Okay, I really know this has GOT to be the long way around doing this... however, what I want is relatively simple one would think. I have a database with a timestamp column. I am using iPhone SDK with SQLite3. I want to have SQLite3 get all records for today (where timestamp >= midnight this morning) .. What i have come up with (th...

how to create a tabbar programmatically and adding buttons on it

i want to add buttons on to my tab bar programmatically in my view... i am having navigation controller but it does not allow me to add these .. i want to create programmatically in my view... ...

IPhone app as a web server, any advice?

I've seen several programs that do this so that one could copy files (that are generated on the iphone via some app) back to the PC. They do this by making the iphone app run as a web server that gives you an ip address. You just connect to this ip via some browser and then you have links to the files. What I'm wondering is how are they...

Buffering NSOutputStream used as NSInputStream?

I have this consumer class that takes an NSInputStream as argument which will be processed async, and I want to push data that comes from a producer class that requires that it has an NSOutputStream provided as its output source. Now how could I set up a buffering (or transparent) stream that acts as the output stream for the producer, a...

Can someone tell me XCode's path to the iPhone?

Hello everyone Im in the process of pre populating a sql file and would like to know where Xcode keeps its folders for apps for the device. For example, the folders to get the apps on the simulator is /username/library/application support/simulator. Can someone please tell me where these folders are for the device? Any help is appreciat...

Cocos2d iPhone sdk: removing background from tilelayer when running an action?

I am try to apply an action to a tilelayer of a cctilemap, but when it starts, the layer adds a black background below the tile layer, which covers anything below it. How would I go about removing this background, or changing it to transparent? ...

Sending loadRequest messages to UIWebView before current view is finished loading causes error

I have a webview as the detail view of a tableView navigation based app. There are "UP" and "DOWN" arrows on the navigationBar that the user can use to page through the different detail views. Everything works fine as long as the user only clicks the "UP" or "Down" arrows once. But if the arrows are clicked multiple times and the loadRe...

Problem trying to translate "+" into character +

I'm having a problem trying to convert a character into a string in Xcode. Here's my code... NSString *temp = [NSString stringWithFormat:@"%@ %@ %@ = %@", inputOne.text, sign.text, inputTwo.text, answer.text]; self.sign.text is supposed to return either a "+", "-", "*", or "/", which it does. However, I'm trying to have the user ...

iPhone -- create UITabBar programmatically?

How does one do this? Note that I do not want a controller. Just a tab bar. ...

How to compile an OSX Cocoa framework from code in an iPhone project?

This question comes from this other one I asked earlier: http://stackoverflow.com/questions/3180574/calling-custom-objective-c-from-a-pyobjc-application I want to re-use a small part of the app logic from my iPhone app in its server-side component, which runs on OSX. Based on what I was told in the other question, it looks like I need ...

-[NSURL initFileURLWithPath:]: nil string parameter' on NSManagedObjectModel

Just trying to get into the Core Data stuff and getting crossed up right off the bat. In my AppDelegate I have the following code: - (NSManagedObjectModel *)managedObjectModel { if (managedObjectModel_ != nil) { return managedObjectModel_; } NSString *modelPath = [[NSBundle mainBundle] pathForResource:@"DataModel" ...

iPhone Objective-C cant use 'new' to allocate?!

I'm creating a Game of Life program for the iPhone and I want to be able to store previous states of the game in a large array, if I take the C approach and each "Grid" is a structure consisting of two ints for X, Y and a BOOL *array where I malloc the memory proportional to X*Y times the size of the BOOL value I can create 1000 of these...

how to create button programmatically and placing on my image in a root vie controller

i have an image in place of tab bar in my rootview controller of navigation controller.... i want to show buttons on to my image at bottom of my view ... thanks in advance for suggestions also.... ...

adding button programmatically is not working in navigation root view why?

CGRect frame = CGRectMake(10.0, 30.0, 32.0, 29.0); UIImage *buttonImage = [UIImage imageNamed:@"visit_icon.png"]; UIButton *stopButton = [[UIButton alloc] initWithFrame:frame]; [stopButton setTitle:@"Button" forState:UIControlStateNormal]; [stopButton setTitleColor:[UIColor blackColor] forState:UIControlEventTouchDown]; [stopButton setBa...

Implementing Multitasking on an iPhone/iOS4 Web App

I am looking to build a web app that implements background audio and fast app switching. These features work out of the box, when run as regular Safari web pages, but as soon as you add the web-app-capable tag, and try to run in full screen mode, this functionality breaks. I did some testing and even the most basic web app will reload e...

Overlay View on top of Streaming MPMoviePlayerController

I am using MPMoviePlayerController to play streaming audio, but I want to show the view that I am launching the movie player from instead of the fullscreen movie player. I am doing this- [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyWindowChanged) name:UIWindowDidBecomeKeyNotification object:nil]; and t...

Dismissing Modal View Controllers

View Controller A presents View Controller B modally, which has a button to present View Controller C modally. Here is my flow: A presents B which presents C When B presents C, I want B to be dismissed, so my only view controllers are A and C. I am not sure where to call: [self dismissModalViewControllerAnimated:NO]; in order to d...

How can I detect an iPhone *4* user through javascript

There are lots of scripts for detecting the User Agent string to detect iPhones and other mobile devices, but strangely enough, the iPhone 4's UA is the same as other versions. My webapp has many HTML5 features that need to be displayed differently for the 326ppi screen than other resolutions. Thanks in advance for any insight. ...

iphone variable in NSString

I need to define a string that will include a string that changes (i can already make that string change) and additional text. for example, NSString *commentsAddress = *somestring*/#comments; now i know it sould be something more along the lines of NSString *commentsAddress = @"%@/#comments", *somestring*; but I can't get this to...

How to get notified when all the NSOperation in NSOperationQueue get completed?

I tried something like _queue = [[NSOperationQueue alloc] init]; [_queue addObserver:self forKeyPath:@"operations" options:NSKeyValueObservingOptionNew context:NULL]; for(NSString *url in [_filesToDownload allKeys]) { UrlDownloaderOperation * operation = [UrlDownloaderOperation urlDownloaderWithUrlString:url folderName:folder fi...