iphone

2 touches drag problem

Hello all, i used the code below to handel the touches in my app and i used for loop in touchesBegan to handel 2 touches in the same time but the problem is if the user make a drag with 2 fingers just one work can i make the 2 works properly ? code: - (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event -(void)touchesMoved:...

How to reload all the tabs in UITabBarController

Guys, Here is the scene - My app is a login based app and I am using UITabBarController in my app, so I add UITabBarController after login successful (in appDelegate.h file ). There is also an option to continue without login. In one section I am showing an UIAlert to user to login to access a particular feature. When user press login...

Best practice for checking data types at runtime objective-c

Hi all, I have JSON data being provided to my application but unfortunatly it is not very well formed. Sometimes I am getting String representations of numbers when I am expecting numbers. For some reason some values may have a prefix of whitespace. What is the best way to deal with this? Currently I am forced to check the types vi...

Search text in html files - iPhone App

Hi I am making an iPhone app for an ebook with ebook data in html files. I have to implement search text functionality for ebook data, book size is fairly large. Can somebody please suggest me recommended practice for searching text in large html files - keeping in view performance and other constraints in iPhone. Thanks. ...

printing int with specified nr of digits

I am trying to print out a 5 digit number as follows: int rdmNr = arc4random()%100000; NSLog(@"%i",rdmNr); I always would like to have 5 digit numbers. Example outputs should be: 00001 10544 00555 78801 But with the previous code I would also get 1 or 555 without 0s. I also tried %5i, but the I just get more white spaces. ...

Iphone stop assetEnumerator

void (^assetEnumerator)(struct ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop) { How can I stop the assetEnumerator run loop? Thanks. ...

HttpRiot other linker flags issue

Hi everyone, i'm developing a game which already uses httpRiot framework to communicate with a server. Now i'm also trying to add an ad-mob library but i'm getting issues with the other linked flags, if I put the -all_load flag my ad-mob service crashes, and if I take it off HttpRiot crashes, anyone knows if there is a way to make HttpR...

parsing a local saved XML file

Good morning every one, I have donloaded an XML File to my documents folder but how can I determinate the path to the file so I can parse it?!? I tryed it with NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString *localPath = [rootPath stringByAppendingPathCo...

UIslider increase 10 by 10

I'm making an UISlider and I don't find how to change the selectable values, I would like the only values possible be 10 by 10. The slider begins at 82 and ends at 362. I want the possible value to be 82,92,102,..... I've tried different things but I don't find [sliderannonce setValue: [sliderannonce value]+10.0 animated:YES]; or s...

hitTest returns wrong UIView

I have a view hierarchy which contains smaller views on a scroll view. Each view can have subviews in it such as buttons etc. For some reason, buttons on the view aren't clicked; exploring this further showed that while the scroll view receives the touchBegan event, the button does not. Calling the hitTest:event: message shows that the...

how to do authentication for web services iphone.

how to do authentication for access web service for iphone. any document. samples. example please help me out. Thanks in advance. ...

Webview in a scrollview to scroll entire view

I have a webview. I want to keep the webview in a scroll view such that it looks like entire view is scrolling. Any suggestions will be greatly welcomed... ...

Frame width has strange behaviour

I want to add a footer view to my gouped table view for now i have this: NSLog(@"width:%f",self.view.frame.size.width); UILabel *lblInfo = [[UILabel alloc] initWithFrame:CGRectMake(50, 30,self.view.frame.size.width - 100, 70)]; lblInfo.text = @"Hellow"; [footerView addSubview:lblInfo]; [lblInfo release]; ...

Testing app unplugged from laptop?

I'm only one month into my iOS development, and already have a sweet gps app running perfect on the iPhone simulator. I'm about to pay the 99 USD to be able to try out the app on my real device (iPhone 4). My question is: can I unplug the device after downloading the app. What I mean is, can I test my app unplugged from my computer witho...

iPhone, how do I remove the localized currency format and produce a double?

I've found this excellent question / answer on how localize a string with the users current currency settings... localize-currency-for-iphone This is the code used... NSDecimalNumber *someAmount = [NSDecimalNumber decimalNumberWithString:@"5.00"]; NSNumberFormatter *currencyFormatter = [[NSNumberFormatter alloc] init]; [currencyFormatt...

Save Text From UITextVIEW ????

Hi Guys! I'm having a problem : i can' find a way to save properly my UITextView in a NSString. I have created 4 UITextViews and i want them to be saved in the same file. Heres the code : -(void)destinataireTextView { self.destiView = [[[UITextView alloc] initWithFrame:CGRectMake(200, 160, 150, 120)] autorelease]; [self.view a...

iAd strange console "Unhandled error"

I'm seeing in the console: "Unhandled error (no delegate or delegate does not implement didFailToReceiveAdWithError:):" Although didFailToReceiveAdWithError is being invoked (I can see that with check points and in the console log) Does someone has any reasonable explanation? It's like it's working and not working all in the ...

[Objective-C] How to use stringWithContentsOfURL:encoding:error: ?

Hi guys, I am trying to use initWithContentsOfURL:encoding:error: like this : NSURL *url = [[NSURL alloc] initWithString:@"http://my_url.com/my_file.xml"]; NSError *error = nil; NSString *my_string = [[NSString alloc] initWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error]; I get a empty my_string variable. I tried th...

Low memory warning for NSObject

I have a subclass of NSObject, it is a singleton which loads a list of images into memory, either from hard drive or downloads them from the internet. I want to release the images stored in memory if the app recieves a low memory message, like in a UIViewController. (it then gets the images from hard drive when it next needs them). ...

UITableView issues

Iam adding objects to NSMutableArray and displaying the value in UITableView. Only the first object of the NSMutableArray is getting displayed.Where am i going wrong? My Code snippet: -(IBAction) segmentedControlIndexChanged:(id)sender { int selectedSegment = ((UISegmentedControl*) sender).selectedSegmentIndex; switch (selectedSegmen...