objective-c

Changing first day of the week in NSDateFormatter

In order to get the days of the week I use: NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; NSArray *weekdays = [dateFormatter shortWeekdaySymbols]; Weekdays gives me an array with the days names but it begins by Sunday. For some reasons I want this array to begin by Monday or Sunday depending on the loc...

sorting 2D arrays in Objective C

Hi Folks, I'm stuck with sorting 2D arrays in objective c. I have a 2D array which I made from two string arrays. NSArray *totalRatings = [NSArray arrayWithObjects:namesArray,ratingsArray,nil]; I've pulled the values using: for (int i=0; i<2; i++) { for (int j=0; j<5; j++) { NSString *strings = [[totalRatings objectAtIndex:i] ...

Add custom picker sort of controller on UINavigationBar

Please have a look on this application http://itunes.apple.com/app/yowza-mobile-coupons/id312021877?mt=8 I just want to add custom picker sort of controller on UINavigationBar Please suggest me any sample or ideas Thanks ...

Why postal code is not coming on address dictionary?

Hi Guys, I am developing application based on geocoder. In my app, to get the user current address, i am using placemark address dictionary method inside geocode delegate method and then, i could able to get all the details (street, city, state, county, countrycode and all) except postalcode. Why postal code is not coming?. Now i am wor...

How to compress Video data while taking video from camera ?

Hey Guys, Is there any way to compress the video data while taking from camera ? There is huge difference in video data bytes from taking camera and from photo library.I want to reduce some memory while taking video from camera. Is any way ? Thanks ...

MKMapView not allowing user interaction on Ipod Touch OS 3.1.3, works correctly on simulator 3.2 / 4.0

Hi, I have been coding and testing an app which uses a navigation controller, tab bar and table views together as shown in this tutorial video: I have also coded a MapView page which shows custom annotations. This seems to work fine in every version of the simulator I have tried it on. This morning I have finally got the app running on...

how to solve problem with modelview controller

hi i am new to iphone. what i did is creating a class with name classA. In viewdidload of classA i declare a modelview controller and display some text and hide the model view controller afetr 4 sec and create another view in the viewdidload.this is fine but while rotating the simulator to landscape mode simulator automatically rotates t...

How can I assign a view to a controller on iPhone?

If I have a UIView, called " someView", than, I have a controller, which is called "myController". I want to assign the someView with myController, how can I do so in code? Thank you. ...

Is there anything wrong with creating a helper function to display an AlertView?

I'm still learning Objective-c and Iphone Dev so I'm willing to take instruction. I was wondering if this is the best way to achive a helper function that displays an alertview. Obviously in my code there are various places (report errors, bad data etc) where I wish to display an alert to my user. Rather than create an AlertView objec...

why using NSArray (and other non-display graphic element) into Interface Builder

Hi, using IB, i found that you could use NSArray not in a programatic way. I was thinking, great, i can make sets of uiviews into an NSArray and then get a proper outlet in xcode and retreiving all my uiviews from the NSArray. The fact is when i put a NSArray into the nib file, i can't do nothing into it's property list. So the fact is ...

iPhone OpenGLES texture loading issue with transparency

Hey, I've been using this method (I think I got it from one of Apple's example code projects): - (void)loadTexture:(NSString *)name intoLocation:(GLuint)location { CGImageRef textureImage = [UIImage imageNamed:name].CGImage; if(textureImage == nil) { NSLog(@"Failed to load texture!"); return; } NSInteger texWidth = CGImageG...

Does objective c have a strip tags function?

I am looking for an objective C function (custom or built-in) that strips html tags from a string, similar to PHP's version that can be found here: http://php.net/manual/en/function.strip-tags.php Any help would be appreciated! ...

Getting UIView Type

I keep seeing examples that manually iterate through all of the subviews of a certain type in a UIView. For example, if you want a click outside of a keyboard to dismiss the keyboard regardless of which field is active, you might: -(IBAction)backgroundClick:(id)sender { [myTextField resignFirstResponder]; [myOtherTextField resi...

how to translate spatial information about uiimageviews from one xib to another xib

what would be the best way to retain information, i.e. positions of UIImageViews created in one to transfer to the other and simple int values for answers to math problems, across two xibs? in other words i have an app that autorotates to the device orientation and loads an xib for that orientation and what i want is anything done in one...

Getting text position while parsing pdf with Quartz 2D

Hi guys, another question regarding pdf parsing... Just read PDF Reference version 1.7 "5.3.1 Text-Positioning Operators" and I am a little bit confused. I wrote some code to get transformation matrix and initial text position. CGPDFOperatorTableSetCallback (table, "MP", &op_MP);//Define marked-content point CGPDFOperatorTa...

Where can I find an efficient R-Tree implementation?

I'm looking for an R-Tree implementation, in C, Objective-c and even C++, which shall be efficient for searching the 2d rectangle in which a point falls ( memory efficiency would also be great, but I can sacrifice a bit more memory for time even while I am on an iPhone ). A good documentation will be appreciated too ...

NSMutableURLRequest setHTTPBody: crash.

Hello. I'm trying to send some data to a PHP script online to submit online scores for my iOS application. The script will require account credentials formatted with the proper escape characters for a HTTP request. It's the setHTTPBody method which cashes the application: [text_field removeFromSuperview]; text_field.tex...

Adding an UIImage to a UITableViewCell for "State Touched"

What's the best way of adding an image for the touch state in a UITableViewCell? I know how to set the cell.selectionStyle but I actually need to add an image (a different one for each row) just when the user is touching it (and it pushes the new view in) Like a "Button State Touched". What's the best way of achieving this? I tried wit...

Using UIWebView to create hyperlinks in UITableView Footer

Hey friends, I am trying to create a UIWebView in UITableView footer. The table is grouped. Actually I am trying to create a hyperlink using UIWebView. For example there should be some text like Hey folks Contact me Contact me should be a hyperlink and I want to place this text in UITableView footer. I am unable to figure out how to...

iPad Modal view not rotating

hey there stackoverflow, So I have a modal view displaying in my app that has a little info for the user to fill out. The problem is that when the device is rotated, some animation occurs, but only in the frame. The form itself does not rotate. All the autorotate options are set to YES. I am displaying it when the user clicks on a f...