cocoa-touch

Deal with potential memory issue in iPhone

What ways are there to deal with memory issues on the iPhone? Is it possible to ask how much memory is available before jumping into a memory intensive section of code? (or perhaps Apple would just say that if you have to use so much memory you are on the wrong platform?) ...

UISegmentedControl like in the AppStore app

How can I get a UISegmentedControl (I think it is one) like in the AppStore app after you chose a category in the categories tab. I do NOT mean a UISegmentedControl on a navigation bar but underneath a navigation bar (see screenshot). http://i.imgur.com/jnY7a.png update: I just found this question: http://stackoverflow.com/questions/2...

Display selection tracker on customized UIView

I have an UIView in which I draw texts using drawAtPoint:withFont:. Now I want users be able to select the texts by touch-and-hold, the same way as with UITextField or UITextView. I can draw selection rectangle without problem, however, I cannot find anywhere in documentation describing how to display the tracker (two blue bars) allowing...

iPhone - Displaying a single string in a view programatically

We have a window filled with little view squares (think of a Calculator). For a specific view on the window we want display a single string in the view without using the Interface Builder to add the string. We need to be able to change the string and have the view refresh. How do we programmatically add a string to a view and show it?...

Add items to NavigationBar (Not using UINavigationController)

Hi, I have a UIViewController with a UITableView in it, and also added a UINavigationBar. How can I add and "edit" button and a "+" button in that bar programmatically? (I have tried using IB, but the title is always replaced, and not other items are added) I am not using a UINavigationController. is my UIViewController standing alone. ...

UIPopOverViewController doesn't load detail data in portrait mode.

Hi. I'm having a problem wiht the popOverController in portrait mode of an splitViewController. I have the common UITableView whit customer names so if you touch one of them his personal data are loaded in UITextBoxes of CustomerDetailView. It's working correctly on landscape mode, but in portrait doesn't. I debug step-by-step, and it...

Checking if UIGraphicsBeginImageContextWithOptions is supported

I'm working on an iOS app. It currently only works on iOS 4 since I use the following method on several occasions: "UIGraphicsBeginImageContextWithOptions". This method is only available in iOS 4 and therefor my app currently crashes/doesn't work on iPhone OS 3. Aside from this method there is no reason why the app should not work on iPh...

KVC: How do I save UIKit structs in plist?

I am using KVC to set properties of objects from a plist. I know I can save them as strings <string>{{66, 114}, {64, 64}}</string> and manually convert to structs, but how can I save for example a CGPoint or CGRect in a plist in a way that Cocoa KVC would understand? The Key-Value Coding Programming Guide seems to indicate that I need to...

Drawing on UIScrollView and UIImageView

I want to draw line on image view then image view is to put on scroll view. How to do that? Any Idea??? ...

touch on window in iphone sdk?

is it possible to handle touchbegin, moved, and ended in UIWindow as it is done in UIView? Is there a tutorial I could review? ...

Core Data: updating a managed object doesn't call the NSFetchedResultsControllerDelegate

I have an issue with my table view not updating when I programmatically change some existing managed object property. I would expect my NSFetchedResultsControllerDelegate to be called in such case, but it isn't. Apple doc says: An instance of NSFetchedResultsController uses methods in this protocol to notify its delegate that the co...

Route-Me \ CloudMade dragging problem

Hi, I'm using CloudMade on iPhone and I've got this really critical issue to solve. The problem is when the user moves the map up\down there is nothing to stop him when he gets to the end of the map. This way he can move the map forever and just see a gray view. How can I prevent the user from dragging the map when he got to its end?...

select file in iphone

I want user to select file from iphone and upload to a http server. example:: GoodReader application has feature in it. Please help me how this can be done. Thanks in advance .. ...

how to take a screenshot of the iPhone programmatically?

Is it possible in objective C that we can take the screen shot in objective c and stored this image in UIImage. ...

Determine if non-numerical characters have been pasted into UITextField

For a specialized calculator I would like to allow copy / paste for a textfield which is meant for numerical values only. So, only numerical characters should be actually pasted or the pasted string should be rejected if it contains non-numerical characters. I was thinking about using UITextFieldDelegates textField:shouldChangeCharacter...

resignFirstResponder causing EXC_BAD_ACCESS

Hi, I've got a UITextField on UITableViewCell, and a button on another cell. I click on UITextField (keyboard appears). UITextField has the following method called: - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField { NSLog(@"yes, it's being called"); owner.activeTextField = textField; return YES; }; Where owner....

Discrepancy between sizeWithFont:constrainedToSize:lineBreakMode: and textView.contentSize.height

Hello, I am using the method [string sizeWithFont:constrainedToSize:lineBreakMode:] to estimate the height of a textView that I am resizing. However, it seems to consistently return the incorrect size. To debug, I wrote the following code: self.textView.font = [UIFont systemFontOfSize:14.0]; // It was this before, anyways NSLog(@"Real ...

can i create a UIViewController comprised of UITableView and mixing with other UIKits

Hi, please patient with my poor english. I'd bad concept of UIView, UIViewController, UITableView, UITableViewController.. Now I'd created a NavigationController and ViewController with SegmentedControl and I don't know how to add a custom TableView in the ViewController. All the examples I've seen are subclassing a UITableViewControll...

How to change Frame.size using CABasicAnimation

Hi i have change the frame size using CABasicAnimation i used below code CABasicAnimation *newanim; newanim = [CABasicAnimation animationWithKeyPath:@"bounds.size"]; newanim.duration=3.0; newanim.fromValue=[NSValue valueWithCGSize:CGSizeMake(0,0)]; newanim.toValue=[NSValue valueWithCGSize:CGSizeMake(self.backgroundImageView.bounds...

Detect when an object touches the edge of the screen

If I have an object of arbitrary height and width that moves around the screen, what's an elegant way of detecting when it touches the edge of the screen? ...