iphone

XCode, iPhone, WebKit Framework - What am I missing?

Hi all, I'm very new to XCode so please excuse my ignorance. I've spent a day now trying to figure out what I'm doing wrong, following several tutorials. I've got a iPhone/Window project setup in XCode. I've got a UITabBar and a UIWebView, when a tab is selected the UIWebView navigates to a particular URL and everything is working great...

latitude/longitude

Is there any way to find out the latitude/longitude of a place using IP address. ...

How to get count of Unique chars in a string

How can I get the number of unique chars in my String? Ex: NSString *myString = @"Hello"; I want the count to be 4 and not 5. I was trying to use the NSCharacterSet of myString and get the count but seems like it doesnt work. NSCharacterSet *myCharSet = [NSCharacterSet characterSetWithCharactersInString:myString]; [myCharSet count]...

Iphone SDK - Count increments by 4 for each button tap

Hi there, I have a simple routine to count everytime the user clicks a button. However the integer (numberOfClicks) increments by four each time. Could the event be happening more than once for each user tap? (btw the action method below is connected to the 'touch up inside' action) - (IBAction)myButtonClicked { numberOfClicks+=1; ...

AVAudioPlayer is not rentrant correct?

It appears that AVAudioPlayer is not reentent. So in the following would soundfx play to completion, delay 1 second, then play again, rather then the 1 second delay - and resultant overlapping playback I desire: // ... AVAudioPlayer* soundfx = [[AVAudioPlayer alloc] initWithContentsOfURL:soundURL error:nil]; (void) makeSomeNoise { ...

Is it a good idea to prefer NSNumberFormatterBehavior10_4 over NSNumberFormatterBehaviorDefault?

I wonder if it would be more secure to rely on a NSNumberFormatterBehavior10_4 instead of default, because default may change arbitrary some day in future, and suddenly the app looks ugly. Or am I wrong with that? ...

What's the point of -setFormatWidth: or -formatWidth from NSNumberFormatter?

The documentation is hard to interpret on this topic. Does this value return me how many characters the calculated format string will contain? Or does it tell me how big actually that string is? Or can I tell it how big (in unit squares or "pixels") the output should be? Maybe someone can point out what this methods do... ...

removeFromSuperView ...how can I remove all my components from every controllerview?

hello all , I have a question concerning UITableviews , the stack and removing components or possibly hiding components on the stack. first I have a function which adds a component (a button ); -(void)addComponent { [self.navigationController.view addSubview:playButton]; } I call this function in my didSelectRowAtindexPath So f...

What describes NSNumberFormatter -maximumSignificantDigits ?

There's no text in the documentation about what that means, but it sounds very important to understand in order to not run into trouble. Does someone know what that is all about the "significant digits" of a number? ...

Finding a string in a string

Hi, Does anyone know a nice efficient way of finding a string within a string (if it exists) in objective c for iPhone Development, I need to find the part of the string in between two words, e.g. here I need to find the co2 rating number in the string, where z is the value I'm looking for ... xxxxxco_2zendxxxxxxx Thanks Richard www...

mobile_fu rendering over AJAX so it seems..

My controller renders regular html, mobile_fu, and javascript as such: respond_to do |format| format.html { render :action => "full", :layout => "application" and return } format.mobile { render :action => "full", :layout => "application" and return } format.js { render :partial => "content", :layout => false and ...

iPhone 3.0 MapKit - Multiple Annotations in the Same Location

Background: I have created an application that allows users to submit an entry to an online database, and view other entries from that database. These entries contain geocodes for latitude and longitude which are used for positioning the annotations on the MapKit. Users can submit the location using either their current location or an ad...

Why does my NSNumberFormatter object print "2" for input 1.0?

That looks like a bug in the API: When my input CGFloat is 0.0, I get this: Input = 0.000000, Output = +0 When my input CGFloat is 1.0, I get this: Input = 1.000000, Output = +2 Obviously that's not what I want ;-) Now here is how I create that NSNumberFormatter object: NSNumberFormatter *formatter = [[NSNumberFormatter allo...

[Iphone] FBConnect : send some images on somebody's wall

Hello I found out how to send some text on the user's wall, with the FBConnect API, on iphone. I even found how to put an image already on the internet : FBFeedDialog* dialog = [[[FBFeedDialog alloc] init] autorelease]; dialog.delegate = self; dialog.templateBundleId = 12345; dialog.templateData = @"{\"image\":[{\"src\":\"http://sample...

How to switch tabs and pushViewController at the same time?

I have two tabs in my app, the left tab is a normal UIViewController, right tab is a navigation controller with a table view inside it. I'd like to allow the user to press a button on the left tab and jump to a specific detail view that belongs to a specific row in the table view on the right tab. In the table view itself I have no prob...

UISwitch inside custom UITableViewCell not available

I have a UISwitch inside a custom UITableViewCell (the subclass of which I call RootLabeledSwitchTableCell). The cell contains a UILabel and UISwitch next to each other. I have a @property called keychainSwitch that points to the switch inside this custom cell: @interface RootLabeledSwitchTableCell : UITableViewCell { IBOutlet UIL...

What's the difference between NSNumberFormatter -setMinusSign: and -setNegativePrefix: ?

I have tried both, separately [formatter setMinusSign:@"?"]; The first one does not change the minus sign at all in my string. Doesn't have any visible effect. If I have a negative value, I see something like -321,65. But not ?321,65 for instance. [formatter setNegativePrefix:@"?"]; Now, with that one I do get a ?321,65 for a float...

Why would this NSNumberFormatter not display all fractional digits?

I have a NSNumberFormatter instance like this: NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; [formatter setAlwaysShowsDecimalSeparator:NO]; [formatter setAllowsFloats:YES]; [formatter setFormatterBehavior:NSNumberFormatterBehavior10_4]; [formatter setMinimumFractionDigits:0]; [formatter setNumberStyle:kCFNumberFormatt...

Mobile Devices get HTTP 504 Error

I am trying to debug why a mobile device trying to connect to my embedded web server is getting a "HTTP 504 Error: Gateway timeout". A PC can connect just fine, it's just the Blackberries and mobile phones that get this error. What does a 504 error mean? What can I do about it? ...

Memory usage VS. CPU usage in the iphone

I'm writting a small game in OpenGL, where I represent Items, enemies, characters, ect with a class. Each class saves references to one or more objects from an Animation class. An animation class contains references to one or more frames, which are textures I already loaded using openGL. Whenever I rotate, scale, ect any element in the g...