iphone

Problem with NSMutableArray

Hi, I have a problem with NSMutableArray. In my program i have a lot of variabile "CFSocketRef". i want to save this in NSMutableArray but i can't. Can you help me? Thank and sorry for my english XP My code: CFSocketRef socketAccept; NSMutableArray *arrayIP = [[NSMutableArray alloc] init]; self.socketAccept = CFSocketCreateWith...

Save UIWebView Access to Current Location

A UIWebView in my app is loading up a site that is requesting access to the user's location. In Safari, it stores this preference and does not ask it again, but in my app, it continues to ask every time. Is there a way to store the user's preference on this so they are not asked every time they use the app? ...

UITextView inside UIScrollView is not First Responder

I have a UITextView on a View that becomes the first responder. When I embed the UITextView inside of a UIScrollView in Interface Builder the UITextView is no longer the first responder. I am not sure what has changed? I would like the UITextView to become the first responder. - (void)viewDidLoad { [super viewDidLoad]; [scroll...

Why is a CoreData forceFetch required after a delete on the iPad but not the iPhone?

When the following code is run on the iPhone the count of fetched objects after the delete is one less than before the delete. But on the iPad the count remains the same. This inconsistency was causing a crash on the iPad because elsewhere in the code, soon after the delete, fetchedObjects is called and the calling code, trusting the ...

iPhone - Launching selectors from a different class

Hi, I'd like to reload a table view which is in another class called "WriteIt_MobileAppDelegate" from one of my other classes which is called "Properties". I've tried to do this via the NSNotificationCenter class - the log gets called but the table is never updated. Properties.h: [[NSNotificationCenter defaultCenter] postNotification...

Launch Apple's Stocks app, with a particular stock selected

I would like to launch Apple's Stocks app to show information for a particular stock, on a non-jailbroken phone. I'm not interesting in how to get a quote or graph a stock myself, just opening Stocks.app. I was hoping that the Stocks app would have a custom URL format, so opening a URL like stocks://AAPL would do the trick. But I haven'...

Is Fast Enumeration messing with my text output?

Here I am iterating through an array of NSDictionary objects (inside the parsed JSON response of the EXCELLENT MapQuest directions API). I want to build up an HTML string to put into a UIWebView. My code says: for (NSDictionary *leg in legs ) { NSString *thisLeg = [NSString stringWithFormat:@"<br>%@ - %@", [leg valueForKey:@"narrat...

[iphone] method created in a seperate class returns "out of scope"

Hey, I have created a Class (subclass of NSObject) which will hold all my SQLs/dbConnections etc.. in a seperate viewcontroller, i have instantiated the SQL's class and performed some actions, all went trough OK. but. one of my methods in the SQL's class is a method defined as follows: -(NSString *)queryTable:(NSUInteger *)fieldnum ...

how to extend a protocol for a delegate in objective C, then subclass an object to require a conforming delegate.

I want to subclass UITextView, and send a new message to the delegate. So, I want to extend the delegate protocol, What's the correct way to do this? I started out with this: interface: #import <Foundation/Foundation.h> @class MySubClass; @protocol MySubClassDelegate <UITextViewDelegate> - (void) MySubClassMessage: (MySubClass ...

How to change UINavigationBar background image - iphone sdk ?

first of all, i read all "changing uinavigationbar color & backgound image", but i couldnt get over my problem. i have a tabbar app with 4 tabs. each tab has navigationcontroller. (i arranged all the objects in mainwindow.xib file in IB) in thew first tab, i wanna display 1.jpg on navigationbars background image in first view. when the...

How to make modal view scrollable?

I have a modal view with a textview and a button. When the keyboard is displayed it covers up some of my UI elements. I'd like my modal to be scrollable so that it can be viewed while the keyboard is displayed. How can I do this? ...

Disable button until text fields have been entered?

I have several uitextfields within a view and I would like to disable the uibutton until all the fields have something entered into them. What's the best way of doing this? Ideally, I'd like to do some basic validation (make sure all entries are numbers) too. EDIT Couldn't get the solutions below to quite work. Below is the version ...

NSOrderedDescending instead of NSOrderedSame for equal strings, why?

Hello, I'm compairing two strings. There are equal. isEqualToString: returns NSOrderedDescending. I thought isEqualToString: would return NSOrderedSame. Can someone explain to me why this happens? example case... NSString *myString = @"1"; if ( [myString isEqualToString:@"1"] == NSOrderedSame ) { // is NSOrderedSame } Since...

iphone dev - loading table content asynchronously

My app has a navigation controller which push and pop a series of views. One of the tableViews loads .xml file from URL and it takes 4-5 seconds. If I click the back button on the navigation bar, it will only respond after the content of the table finish loading. Is there an easy way to load the content asynchronously so that the app wil...

UIVideoAtPathIsCompatibleWithSavedPhotosAlbum generates error implicit declaration of function, why?

In my project I am trying to save video to the iPhone after being taken by the camera. When I call the method: UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(path) It reports the error: Implicit declaration of function 'UIVideoAtPathIsCompatibleWithSavedPhotosAlbum' I've imported MobileCoreServices/UTCoreTypes.h I was previously usi...

Facebook Connect iPhone API logout not working

I am attempting to write a Facebook integration in an iPhone app I'm working on. I have it logging in just fine, but I don't like the idea of being able to turn a feature on without being able to turn it off. So, in working on the logout functionality, I have been caught in a snag. - (IBAction) logoutClicked:(id)sender { if (fbLogge...

iPhone app launch times and Core Data migration

I have a Core Data application which I plan to update with a new schema. The lightweight migration seems to work, but it takes time proportional to the amount of data in the database. This occurs in the didFinishLaunchingWithOptions phase of the app. I want to avoid <app> failed to launch in time problems, so I assume I cannot keep the ...

Why is my UIWebView not scrollable?

In my most frustrating roadblock to date, I've come across a UIWebView that will NOT scroll! I call it via this IBAction: -(IBAction)session2ButtonPressed:(id)sender { Session2ViewController *session2View = [[Session2ViewController alloc]initWithNibName:@"Session2ViewController" bundle:nil]; self.addictionViewController = ses...

iPad iPhone scale background images

Just wondering if anyone else has experienced the iPad/iPhone scaling their background images down to fit the view port. In my case, I'm swapping out background images via javascript, and the new background images are super wide to fit large displays. However, the iPad is scaling down the background images that are added to the DOM via ...

Initialization of AVAudioRecorder with aac

Hi everybody, I want to initialize a AVAudioRecorder with a aac file format, but it doesnt work... Whats wrong with the following code? soundFilePath = [soundFilePath stringByAppendingPathExtension:@"aac"]; NSURL *url = [NSURL fileURLWithPath:soundFilePath isDirectory:FALSE]; NSMutableDictionary *recordSetting = [[NSMutableDictionary...