iphone

What's the consequence when Core Data detects an optimistic locking failure when trying to save?

I get it: When a managed object context saves, the snapshots of all edited objects are compared against the values in the persistent store to see if the PS has changed since the snapshot was made. If it did change, then there's a conflict and optimistic locking failed, according to Apple. But now, what's the consequence of this? What ha...

IPhone SDK Home Button

Is it possible to override the default behavior (close app) of the Home Button? And if how do you do that? ...

Detecting rotation to landscape manually

hi all, I am working on an iPhone application based on UITabBarController and UIViewControllers for each page. The app needs to run in portrait mode only, so every view controller + app delegate goes with this line of code: (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { return (interfaceO...

IPhone Configuration utility not allowing a certain app to be installed with it

I'm building an app and using the iPhone config utility to add it to different devices. Dragging the app file from 'product' in xCode worked fine previously, but for some reason when I drag the app it never appears in the applications list of the utility. I downloaded some Apple source code, built it, and dragged across and it works fine...

How to efficiently track my geolocation during traveling using iPhone

I'm going to travel through Thailand and I want to keep track of my location to geotag photos afterwards taken with a digital camera (iPhone's camera is not good enough). There are two things that are important here: I don't want to update manually I want the battery to last as long as possible, since the times I will be able to charge...

Retrieve Value from NSString

Hi, i have a NSString instance ,i want to retrieve value from it and store it into an integer. This is wat i am doing but its not working. NSString *totalcnt; char *str = totalcnt; int a = atoi(str); Help me out. Thanks Taimur ...

How to determine the current view bounds in split view of Ipad App?

Hello friends, I have tried following code to determine current view bounds in shouldAutoRotate.. fn UIViewController *temp1 = [appDelegate.splitViewController.viewControllers objectAtIndex:1]; float screenwidth = temp1.view.bounds.size.width; float screenheight = temp1.view.bounds.size.height; bt actually when u rotate from one m...

iphone @property(retain), init(), and standards

I'm new to the memory management of the iphone and had a question about standards/correctness. My header file declares: IBOutlet UITabBarController *tabBarController; @property (nonatomic, retain) UITabBarController *tabBarController; In my init() code I was doing something like the following: self.tabBarController = [[UITabBarCon...

iPhone Objective-C Form Validation

Hello, I am an old developer but new to Objective-C and iPhone development. I am looking for the best way to do form validation for values entered. I have been googling for a while and can't find any good code, but might be using the wrong key worrds, etc... I am looking for things like catching for empty string, numeric validation, ...

UIgestureRecognizer in a view inside a UIScrollView

Has anyone managed to get a UIGestureRecognizer to work on a UIView that is a subview of a UIScrollView? My callbacks never seems to get called. As a simple example, I want to have a paging scrollview and on the third page listen for a tap with a UITapGestureRecognizer. However I can not get it to work. Here's how I would do it: self....

Forcing entry of certain character types in UITextField

If I have a UITextField which the user is inputing a registration number, which has the format: 11-11-1111 (that is 2 digits, a dash, 2 digits, a dash, four digits) How do I force the user to enter this kind of data only (as they are actually entering it)... so they can't enter anything except 0-9 in the first character, and only '-' f...

build and analyze not working in my project

In my iPhone Project when i select build and analyze (shift + mac + A ) it will give me all potential memory leak in my project... but in my current project it is not working... when i intentionally put a memory leak and select build and analyze... it doesn't give me any potential memory leak as analyzer result if i write NSMutableArr...

Dismissing the keyboard with UISearchBar, without resigning first responder.

Hey, I was working on a navigation-based app on iPhone similar to the contacts app. When you input something in the search bar, and scroll in the table (in the contacts app), the keyboard goes away. I don't think it resigns first responder though, because when I try and do that in -(void)scrollViewDidScroll:(UIScrollView *)scrollView, ...

How can I make an app that connect to a webserver to iPhone.

Hi, I need make an app to iPhone that connect to a webserver. This app connnect a webserver and return the content formated to iphone. Thanks for help me. ...

How to set the UITabBars items property when accessing through a UITabBarController?

Hi I have build a UITabBarController programmatically and populated its viewControllers property. When I run this the tabBar buttons are, of course, empty, I tried to access the tabBar property on the UITabBarController to set its items property to my text/images, which made the app crash. Going through the documentation for the UITabB...

UIViewController: where can I put custom initialization

Hello. I'm very new on iPhone development. I wondering where to put some custom initialization of an instance variables for my UIViewController. Can I use initWithNibName:bundle:? Thanks. ...

UISearchBar animation hidding button

Hello I currently have a UISearchBar (attached to a UISearchDisplayController), but I reduced the width of the search bar so I could display a custom button to its right when the search bar is not selected. The button is used to access other views. However, when I select the search bar and then press cancel (or even perform a search) a...

managing IB objects without iboutlets

i have got 24 buttons in my project.I need to manage them but I don't want to get my MainViewController polluted by 24 declarations of pointers, properties & synthesizes. i was thinking about using buttonPushed functions and do it like: > -(IBAction)buttonPushed:(id)sender{ > UIbutton *button=sender; >[buttons addObjectAtIndex:[sende...

iPhone text editor syntax highlight

Hi, As the title suggests, I am trying to add a text editor with syntax highlighting to a project. I have asked a similar question before and got pointed in the direction of either: a) a UITextView and NSAttributedStrings Or b) a web view Can anyone shed some light on using either of These methods or suggest an alternative? I have se...

Undefined symbols after installing new xcode 3.2.3 build

I want to move to the new XCode 3.2.3 GM Seed build for development, but when I bring up my project I get 'base sdk missing' because my project is set to use iPhone SDK 3.0. If I change 'base SDK' to iPhone 3.2 or 4.0 and then compile I get a lot of errors that I don't understand. I dumped a few of them below. Can anyone tell me what ...