Remove all but numbers from NSString
I have an NSString (phone number) with some parenthesis and hyphens as some phone numbers are formatted. How would I remove all characters except numbers from the string? ...
I have an NSString (phone number) with some parenthesis and hyphens as some phone numbers are formatted. How would I remove all characters except numbers from the string? ...
Does anyone know how I should go about storing a UIImage with the version of ObjectiveRecord packaged with ObjectiveSync? (Note that the version of SQLPersistantObjects in ObjectiveRecord is older than the current version) At the moment, I am attempting to store the UIImage data as NSData: @interface Picture : SQLitePersistentObject { N...
is there a way to turn the default UITableViewCellAccessoryDetailDisclosureButton from blue colour to black colour???? ...
Hi, can someone tell me why there is a * in the line? What does it mean for the declaration? NSString *someString; Thank you guys edit: Thank you it helps me a lot but sometimes i see declarations without * example: BOOL areTheyDifferent; why there is no pointer in this declaration? ...
Trying to alert user when internet is unavailable (and retry when they dismiss message). The screen slightly dims (in preparation for alert), but the alert never displays. Is the while loop interfering with the alert? -(NSArray*)getResponse:(NSString*)page { NSError *error; NSURLResponse *response; NSData *dataReply; NSString *strin...
This may seem like a stupid question, but what message do i send to the NSSet class to determine how many times a particular control has been tapped? ...
Hello I have a password field in my application (UITextField). When user enters text in the field, I want it to display * instead of the text they entered. I have tried using the UIControlEventEditingDidEnd of UITextField but it only shows one * at the end when editing but I want it to display the *s as soon as any text is entered, lik...
Please help a macro beginner... I created a simple macro for loading images and split it up into several lines so that I can log every time code generated from the macro is executed (for debugging). It looks like this: #define LOAD_PNG(L_I_IMAGE_NAME) ({ \ PngImageClass* __tmp; \ printf("Loading png: %s", L_I_IMAGE_NAME);\ __tmp = [imag...
I give it 0 and 400 and it returns me sometimes values above 400. That doesn't make sense. - (float)randomValueBetween:(float)low andValue:(float)high { return (((float) arc4random() / RAND_MAX) * (high - low)) + low; } that's actually a snippet I found on the net. Maybe someone can see the bug in there? ...
As an example, I want to write out some string value, str, to a file, "yy", as it changes through each iteration of a loop. Below is how I'm currently implementing it: NSOutputStream *oStream = [[NSOutputStream alloc] initToFileAtPath:@"yy" append:NO]; [oStream open]; while ( ... ) { NSString *str = /* has already been set up */ ...
Hi, I have an NSURL object which gets data from my site, based on a variable entered by the user into the search bar. I split this data into an NSArray. Once I have done that I wish to display the data in a UITableView. My question is this. Is it possible to load the data into a UITableView dynamically? i.e. Program loads, no data s...
I have three pins on a mapview. I'd like to give each one a different color. In the delegate method viewForAnnotation, I'm doing this: - (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>) annotation{ MKPinAnnotationView *annView=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdenti...
I have an NSArray that contains date strings like this: "Thu, 21 May 09 19:10:09 -0700" I need to sort the NSArray by date. I thought about converting the date string to an NSDate object first, but got stuck there on how to sort by the NSDate object. Thanks. ...
Does anybody know a good reference about Objective-C/Cocoa Best Practices? Project organization, methodologies, naming and etc. ...
I went through this tutorial Your First iPhone Application and it worked great. My question is about the line in the tutorial that reads as follows: The view controller is also going to be the text field’s delegate; as such, it must adopt the UITextFieldDelegate protocol. To specify that a class adopts a protocol, in the interface a...
I have the next question: In my project I have the next: UItabbarController ....Some UINAvigationControllers.... *(1) UINavigationController UIViewController (UItableView) - When select one row it goes to...(by push) to: UIViewController (UItableView) - And here the same than before, for each row i open a new tablev...
What skills should a junior Java developer have? I'm also interested in iPhone (Objective-C) development. What technologies/languages should I know to get a position as a Java developer or an iPhone/Obj-C developer? J2SE preferable... What would be better - study only Java/Objective-C or try to work with two? ...
Hello, i read much about Core Data.. but what is an efficient way to make a count over an Entity-Type (like SQL can do with SELECT count(1) ...). Now i just solved this task with selecting all with NSFetchedResultsController and getting the count of the NSArray! I am sure this is not the best way... thank you ...
I have a custom TableView cell that contains a TextField and I want it to become the first responder as soon as the view is shown but [textcell.textfield becomeFirstResponder] does not work. I know it's because it's a custom cell in another class and I even tried it there and it didn't work. Anyone know how to pull this off? Thanks... ...
I have two arrays in Objective C and I need to find what index something is so I can insert it in the same place. For instance, lets say I have a "name array" and an "age array". How do I find out what index "charlie" is in the "name array" so I know where to insert his age in the "age" array? Thanks ...