cocoa-touch

need guidence for creating a calender

Hi, I have to use a calendar in my iphone application. I tried hard but could not find any inbuilt API in iphone sdk for this purpose. Now i am going to create calendar by myself and need some guidance for it. I have created 5 rows of 7 buttons(i.e, 35 buttons in all) and will be using it as the date and then later i will add other gr...

How to recognize diagonal swipes on the screen?

Hello, I'm using UISwipeGestureRecognizer successfully to capture and action when gestures on the screen are made with single or multiple touches in Up, down left or right directions using the standard tools. However what I really need to do now is have the device recognize diagonal swipes in the same way. Does anyone have any ideas wh...

UIAlertView rotating interface with keyboard visible

I have a UIAlertView that has a text field. So when it shows up the keyboard shows up too. To get the alert view in a better place I set a transformation to it: CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0.0, 180); [alert setTransform:myTransform]; This works fine, as long as the interface orientation does not ch...

Use modal view as "normal" view

I want to use a modal view (UIViewController) as a "normal" view, which can be pushed on the navigation controller stack. Normally, a modal view is presented like this: LoginViewController *myView = [[MyViewController alloc] init]; UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:myView]...

iPad view appears sideways

I am working on an iPad app (which will not be submitted to the App Store) which supports only landscape mode. Most of the views in the application are pushed onto a UINavigationController with a hidden navigation bar. When I add the following code in the top view controller in the aforementioned UINavigationController, the new UINavig...

Is it possible to determine how the app was built?

Is there any way to determine in code whether the app currently running is a developer, ad-hoc, or app store build? ...

Programatically make keyboard go away

I made a text field but I didn't use Interface Builder, I did it programatically in XCode. So now I need a programmatic way to make it resign first responder so that the keyboard will go away when the user presses enter. ...

How to recreate the UITabBarItem image filter?

Hi, I'm writing a custom UITabBar replacement, and I would like to know how to recreate the filter that the built-in implementation does with the UITabBarItem image - that blue shining on selected tabs and gray gradient on unselected ones. I guess it's a matter of using the source image alpha value as a mask and overlay it with a pre-ma...

Schedule NSStreams on secondary thread

Hello, In an iPad app I'm developing, I need to put the network handling on a separate thread since it occasionally blocks the UI of the app. At the moment, I have created a Connection object in which all the networking logic goes (NSStreams and its delegate methods). The main obstacle is how to create the secondary thread and schedule...

Button does not respond to touches.

In my app there is a background on top of the window: UIImageView *mybg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bg_large.png"]]; [window addSubview:mybg]; then a button in top of the background: UIButton *infoButton = [[UIButton buttonWithType:UIButtonTypeInfoLight] retain]; infoButton.frame = ...

Use SCAN BARCODE on UIWebView ? (Ipod Touch)

Hi, I have bought a Scan Bar Codes (hardware external) for my ipod touch 2g, i am developing cocoa app on xcode. I have implemented a webview but i cannot use him, in UITextField of my webpage. I want launch a webpage (by UIWebView, safari), google.com and i push my button of my scan when the virtual keyboard appears. This action will...

iPhone / Objective C - Communication between ViewController / best way to implement?

Hi, I'm doing a iPhone app. I created my own SwitchViewController Class (linked to the App-Delegate) which actually just changes the various other Views / ViewControllers (e.g ViewA, ViewB) while the app is running. When I know recieve a tap-gesture in the ViewController-A I would like to trigger a method (eg. switchViews:(id)sender) ...

didSelectRowAtIndexPath working on simulator not iphone

Hi all, Hopefully a nice and quick one for you... the below code is working fine on the simulator, but not working on the iPhone, any ideas? - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if([[dataTable cellForRowAtIndexPath:indexPath].textLabel.text isEqualToString:@"Telephone"]){ ...

how to display just 10 rows in uitablView iphone application.

hi all. I have a large data to be displayed in Tableview cell can anybody tell me how to show just 10 of them after click display button. and then add more 10 when user click on load more button. Thanks in advance. ...

Loading a Localized UIImage

I need to load localized images in my iOS app, but also have to take into account that they might need to be the ...@2x kind. How can I do this? ...

Handling UITextView Data inside a Table View

Hey folks, i have this MainViewController, which is a controller for my table view. Whenever I press a row on the table view i go to my employeeViewController. Which is a normal view with a Text View inside of it. So my hierarchy looks like this: -Window --Navigation Controller ---Navigation Bar ---Main View Controller ----Table V...

iOS pre-poulate dynamic message in Facebook Connect Publish Stream

I'm trying to pre-populate the publish stream in the Facebook Connect code so that when the user wants to share on FB its already got the dynamic info. here the date code that calculates time intervals on viewdidload NSString *dateStr = @"20100716"; NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init]; [dateFormat setDateFormat...

Adding UIToolbar with two UIBarButtonItem to a UINavigationBar: poor UIToolbar and what about iPhone 4

I'm following the second tip from here. In this tip two UIBarButtonItems are put together in a UIToolbar. Finally, the UIToolbar is added to the UINavigationBar. Now to my problems: 1) A white line is on top of the UIToolbar. If I increase the size of the UIToolbar, the gradient is wrong. I'm using the following size for the UIToolbar: ...

drawrect Vs layoutsubvies - NSView - Cocoa touch

Hi, I can't find a decent answer to explain me the difference between these 2 functions. when does every one gets called, and how does one different then the other ? for example , can't I just layout my views inside drawrect ? Thanks ...

How to change the keyboard type for a text field in Xcode

I created a text field in XCode, not Interface Builder. In IB you can select different keyboard types. How can you do the same thing in XCode? ...