iphone

How can I check the data usage by an app with iPhone sdk in OS4?

Thanks in advance ...

How can I make a call inside an iPhone application?

I want the user to make a call from my application Something like this post, but instead of sending an email, make a call http://stackoverflow.com/questions/310946/how-can-i-send-mail-from-an-iphone-application Tanks! ...

repeat playing automatically

I use below code for play sound NSURL* musicFile = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"01" ofType:@"mp3"]]; AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:musicFile error:nil]; [audioPlayer play]; I want to repeat this sound file automatically when it's finish How ? ...

CoreText: In any one line is it possible to mix alignment?

Is it possible to mix alignment in Core Text e.g., both kCTRightTextAlignment and kCTLeftTextAlignment I would assume the RightAligned text gets drawn from the right, and the left aligned from the left, but it seems to use whatever alignment is defined first on the line. ...

Refreshing and Deleting content in background thread error (NSFetchedResultsController)

Hi, I'm using an NSFetchedResultsController to fill content for my UITableViewController. I'm using an NSOperation to gather data from a webService (I'm using a separated ManagedObjectContext as it's another thread) When the data is saved my ViewController (wich is the NSFetchedResultsControllerDelegate) is called and i merge my MOCs u...

table view not loading nib when cell is selected

i have the following code if ([[tableView cellForRowAtIndexPath: indexPath].textLabel.text isEqualToString: @"added"]) { NSLog (@"hello"); FinalViewController *anotherViewController = [[FinalViewController alloc] initWithNibName:@"FinalViewController" bundle:nil]; NSLog (@"hello2"); [self.navigationController pushViewC...

Send data to a SPECIFIC iPhone application through mobile network (No Internet).

I am looking for a way to send data to a SPECIFIC iPhone application without going through Internet... thus using the mobile network. Thanks. ...

HTML5 canvas drag events on iPhone (Safari or UIWebView)

Hi, I have a simple "drag to draw" doodle style HTML5/canvas implementation which uses the 'mousemove' event on the canvas. E.g.: canvas.addEventListener( 'mousemove', drawingFunction, false ); This works fine on, say, Safari or FF on the desktop. However, when run on an iPhone, dragging only scrolls the webview around the screen. No...

MJPEG in UIWebView - How to change scale with javascript (iphone)

I'm displaying an MJPEG stream in a UIWebView. I have two different sizes I want to use for the UIWebView. The video size is constant. So setScalesPageToFit isn't flexible enough, and I have no control over the source to change the viewport meta tag. So I'm left thinking that I need to do this via javascript (of which I have very lit...

viewWillAppear, viewDidAppear not being called, not firing

(This is both question and answer since it took quite a bit of digging to find the real answer.) Symptom: viewWillAppear, viewDidAppear were not being called in my UIViewController. Cause: Embedding a UINavigationController or UITabBarController (my case) in a UIViewController somehow interrupts with the calling of these methods. Sol...

Object leaked... how can i solve it?

When i do "Build and analyze" xCode gives me the following warning: Potential leak of an object allocated on line 70 Method returns an Objective-C object with a +1 retain count (owning reference) Looping back to the head of the loop Object allocated on line 70 is no longer referenced after this point and has a retain count of +1 (obje...

Using Cairo on iPhone?

I'm doing some work on a potentially cross-platform C++ application and for Windows and OS X it seems that Cairo will meet most of my needs for 2D graphics and allow me to share a lot of code between platforms. In an ideal world I'd really like to be able to use the same (or very similar) drawing code in iPhone/iPad apps. I realise tha...

Using NSNumberFormatter to get a decimal value from an international currency string

It seems that the NSNumberFormatter can't parse Euro (and probably other) currency strings into a numerical type. Can someone please prove me wrong. I'm attempting to use the following to get a numeric amount from a currency string: NSNumberFormatter *currencyFormatter = [[[NSNumberFormatter alloc] init] autorelease]; [currencyFormatte...

Best way to remove sprites from an NSMutable array based on proximity to another sprite?

I have an NSMutableArray of Sprites and I want to remove a few of them based on their proximity to another sprite. So say I have 10 sprites and I want to remove the first 3 that are closest to another sprite. I can't think of a sophisticated efficient way of doing this, anything i've come up with so far seems overly convoluted and ineff...

graph.facebook.com and FacebookConnect on iPhone: How can I remove a "like"

I'm developing an iPhone application using the Facebook Connect APIs I arrived to set the "Like" on a post using the following code, NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://graph.facebook.com/%@/likes", discussion.postId]]; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; [request set...

Can I use NSDateFormatter to convert this date string to an NSDate?

I have this string... 2010-08-24T16:00:00-05:00 and I'd like to extract the time portion from it (i.e. 16:00) and convert it to its 12-hour equivalent (i.e. 04:00 pm). I'm trying to use NSDateFormatter to accomplish this, but it's not working... NSDateFormatter* dateformatter = [[NSDateFormatter alloc] init]; [dateformatter setDateF...

Iphone - How to enable application access to media on the device? - ALAssetsLibraryErrorDomain Code=-3312 "Global denied access"

OK, so I have had this problem before and solved it unknowingly and now it is reoccurring! "error: Error Domain=ALAssetsLibraryErrorDomain Code=-3312 "Global denied access" UserInfo=0x169aa0 {NSLocalizedFailureReason=The user has denied all applications access to their media., NSLocalizedRecoverySuggestion=This setting can be chan...

NSDateFormatter to change a string

Hi, I have a string in this format "dd.mm.yy" (23.08.10). I would like to convert them to a Date format using NSDate *currentDate = [[NSDate alloc] initWithString:new.date]; But i need a format like this: "yyyy-mm-dd HH:MM:ss +0000" to compare two dates! How can I do that? I know that I have to user NSDateFormatter but I dont know h...

How do I create a combobox type control on the iphone?

All I see is a list (which looks like a rolodex), how do I make this like the combo box option? ...

Google Maps http request not working

I am trying to use an http request to google maps to obtain the driving distance between two locations using JSON. However, it seems these are treated different in a browser than in the (iphone) app. I create an NSString which holds the URL, using coordinates and %20 (a space). I NSLog() the URL to make sure, and it seems ok (ie it work...