iphone

UIViewControllers and UIWebView

Hi guys, I am a newbie at iPhone development and have a question, which may end up helping understand this concept in general. Basically, I have UIViewController which loads up a view with a bunch of stuff. Now I want when a user clicks on a button, to load up a different view, which happens to be a webView. Now, I want the weview to lo...

UIToolbar items not showing

I have a UINavigationController that gets pushed a DetailsViewController. In this DetailsViewController, I want to use the toolbar that comes with every UINavigationController (atleast, since iPhone OS3.0). So, in viewDidLoad in my DetailsViewController I create a UIBarButtonItem, I add it to an array and hand it off to the navigation ...

What kind of data is in an "enum" type constant? How to add it to an NSArray?

What kind of information is stored behind such an enum type thing? Example: typedef enum { UIViewAnimationCurveEaseInOut, UIViewAnimationCurveEaseIn, UIViewAnimationCurveEaseOut, UIViewAnimationCurveLinear } UIViewAnimationCurve; I am not sure if I can safely add such an enum constant to an array. Any idea? ...

Presenting ViewController behind another one

I have image picker which collects data for another view controller (TTMessageController from three20) and I want this message composer to appear behind image picker, so when image piker slides out there will be already appeared message controller with pre-filled data. Code like this [self.navigationController presentModalViewControlle...

uitoolbar location changes according to different iPhone SDKs

Hi all, I have a UIToolbar at the bottom of the view. when I run the application using iPhone Simulator 2.2.1, the toolbar is displayed in place. But when I run the application using iPhone Simulator 3.0 the toolbar is shifted up from its place. Is there any way I can fix this ? I would appreciate any help. Thanks, Sarah ...

Trying to Write NSString sha1 function, but it's returning null

I have the following Objective-C function: +(NSString *)stringToSha1:(NSString *)str{ NSMutableData *dataToHash = [[NSMutableData alloc] init]; [dataToHash appendData:[str dataUsingEncoding:NSUTF8StringEncoding]]; unsigned char hashBytes[CC_SHA1_DIGEST_LENGTH]; CC_SHA1([dataToHash bytes], [dataToHash length], hashBytes)...

strange behavior of iphone MKMapKit

Whenever I set the region property of the MKMapKit it doubles the span. For example: MKCoordinateRegion currentRegion = map.region; // assume the current center of region is around New-York and the span is 2 by 2 map.region = map.region; // assign the region to itself MKCoordinateRegion newRegion = map.region; // the span of newRegion...

Can I install gcc in iPhone with out jailbraking it?

Hey... Is it possible to install gcc in iPhone (3.0 or above) with out jailbraiking it? If yes, Do you know a good place where I should start ?(please don't say "Google it!", lol) If the answer is no. What is the demerit of jailbraking my iphone? or ipod touch? I would like to be able to use gcc inside my app , Thanks in advance. ...

How can I make an image in a grouped tableview cell the width of the screen?

I have large images displayed in a grouped tableview. I would like the images to fill the entire width of the screen. I have been able to make this work using a tableViewCell interface builder, but in an attempt to improve performance I am now trying to do this programmatically. However, I have not been able to get the image to be flush...

Uploading and downloading via ftp with iPhone SDK

Could anybody explain to me the process of uploading to and downloading form and ftp server with the iPhone SDK. If you could just point me in the right direction (e.g. documentation etc.). How difficult is a task like this? Thanks in advance. ...

iphone opengl es glDrawElements issue

Hi guys, I'm quite new to opengl es so I'm wondering if it is possible to use the glDrawElements function to draw two separate squares(I actually want to draw more than two, but for learning I will create only two) ? the vertex array looks like this: CGFloat array[] = { 0.2, 0.4, 0.2, 0.2, 0.4, 0.2, 0.4, 0.4, 0.8, 1.0, ...

UIDatePicker vs. UIApplicationSignificantTimeChangeNotification

I'm handling UIApplicationSignificantTimeChangeNotification in my app and all the other screens in the app are gracefully refreshed when midnight comes. The one I have trouble with is with UIDatePicker. UIPickerView has refreshAllComponents method which I use in another screen to make an update on midnight change. I would like to have th...

How to explode this string into substrings?

Consider this example: zh_Hant_HK format = yy'年'M'月'd'日' ah:mm Not sure if you can see it, but I see a lot of chinese symbols in there. I've got that string out from a date formatter, which corresponds to a Asian locale. Do I have to consider anything special when trying to get "character" by "character", i.e. looking at every char se...

Replicating iPhone Safari's Tabs

Hi Everyone: I am wondering if there is some way to replicate Safari (on the iPhone's) tab behavior of scrolling through the webpages. Is it an API or some code that makes this happen, and how would I create this in my own app? I saw this post: http://stackoverflow.com/questions/1220354/uiscrollview-horizontal-paging-like-mobile-safar...

Just can't seem to fetch the mobile Gmail html, what is wrong?

I'm trying to cache the mobile Gmail webpage because UIWebView does not cache the content itself (mobile safari does, but not UIWebView). I tried the methods listed here http://stackoverflow.com/questions/992348/reading-html-content-from-a-uiwebview basically saving the html either directly from URLRequest or from UIWebView itself. Whe...

unichar and NSString - how interchangeable are these?

There is an NSString method -characterAtIndex: which returns an unichar. (unichar)characterAtIndex:(NSUInteger)index I wonder if this unichar, which obviously is not an NSString, can be converted into an NSString or feeded to an NSString for comparing purposes? And: Does an NSString internally just consist of an array of uni...

How to properly set "Mode" for laying out controls on a UIScrollView

I have a UIScrollView with 5 controls on it like so: [UIButton1] [UIButton2] [UITableView1] [UIButton3][UiButton4] What I would like to be able to do is to adjust the UIScrollView size, and have the contents lay out properly with the top buttons at the top, bottom buttons at the bottom, and the table view sizing to take up the middle...

Performant way to build long strings in a loop?

I have a loop that builds up a pretty large string. With every iteration a little string snippet is added to that string, and that string becomes bigger and bigger. Is there something better than using an NSMutableString and appending another string to that? ...

How to take an NSString out of an NSMutableString?

That's somewhat confusing. NSMutableString inherits from NSString, but does that also mean that I can pass an NSMutableString anywhere safely where actually an NSString is wanted? And can I assign an NSString to an NSMutableString? How would I get an NSString out of an NSMutableString to avoid problems, if any? ...

iPhone pagination dots??

Does anyone know how to incorporate the iPhone's (and iTunes) pagination dots into a web page? The web page I'm working is for the iPhone, but is not a native app, just an iPhone optimized web site. I figured out how to do horizantale finger scrolling - major headache - but not the client is asking for some pagination to display as the...