cocoa-touch

NSURLRequest to NSString

how can i convert NSURLRequest to NSString ? ...

How to add a custom subview to a UITableViewCell derived class when the UITableViewCell is loaded using loadNIB

Hi! I am trying to add a custom view control to a custom UITableViewCell which I had designed in the interface builder. Now, to load UITableCellView I am using NSArray * loadedViews = [[NSBundle mainBundle] loadNibNamed:@"CustomSearchResultsCell" owner:self options:nil]; What method of the CustomSearchResultsCell class will be call...

iPhone - Debugging EXC_BAD_ACCESS crashes

From times to times, while debugging an Application, I see this error on Xcode: Program received signal: “EXC_BAD_ACCESS”. and the debugger does not stop on the problematic line. In fact the debugger just shows me a page with a bunch assembly language code and that's it. I have to have paranormal powers to figure out where the exact ...

Pinch zoom without UIScrollView based control

Is there an "accepted" way of performing (pinch) zoom on a view that is not based on UIScrollView? ...

Custom UILabel does not show text.

Hi! I've made an custom UILabel class in which i draw a red line at the bottom of the frame. The red line is showing but i cant get the text to show. #import <UIKit/UIKit.h> @interface LetterLabel : UILabel { } @end #import "LetterLabel.h" @implementation LetterLabel - (id)initWithFrame:(CGRect)frame { if (self = [sup...

Which of the view lifecycle methods should I do performFetch for Core Data?

Hi, my app shows a map with annotations fetched from core data. Currently I do performFetch in viewDidLoad for the map, however, this is delaying the map from appearing immediately on the screen when I select its tab in my tabViewController. Is there a more appropriate place to call performFetch or is there something else I'm doing wro...

How to figure out the font size of an UILabel when -adjustsFontSizeToFitWidth is set to YES?

When myLabel.adjustsFontSizeToFitWidth = YES, UILabel will adjust the font size automatically in case the text is too long for the label. For example, if my label is just 100px width, and my text is too long to fit with the current font size, it will shrink down the font size until the text fits into the label. I need to get the actual ...

How do I reload a tableView contained within a UIViewController?

I want to reload the data within a table view that is contained on the root view of my application. The root view of my application (called RootViewController) is a UIViewController that has a corresponding NIB file. I added a UITableView component to the RootViewController.xib via IB. In the header file RootViewController.h I ensure Ro...

ssh framework for iphone

I am writing an iphone app to connect to an SSH server and perform some commands like reboot or check the uptime of the server. Is there a framework which lets me login to some server and invoke some commands on a linux server. ...

UIProgressView not updated

Hello, I have a UIProgressView that I am trying to change the progress but is is never updated. My "slow" operation is done from a NSoperation/NSOperation queue so it should be multithreaded. Did you already experienced this or do you have any idea to solve this? Thanks :) ...

Using UITouch inside a UIScrollView

Hi all, Just toying with the SDK and I was wondering if possible a UITouch event can work inside a UIScrollView. I have setup a UIScrollView which handles a large UIView, inside the UIView is a UIImageView, I've managed to get the UITouch to drag the UIImageView outside of the UIScrollView but inside it's not registering the event. I ...

Is it valid to ignore an return value of an method in objective-c?

For example, when I call a method that returns an value, but I'm not interested in this at all, can I safely ignore that? Example, instead of: CGSize size = [str sizeWithFont:myFont minFontSize:19.0f actualFontSize:&actualFontSize forWidth:150.0f lineBreakMode:UILineBreakModeClip]; ...do this: [str sizeWithFont:myFont minFontSize:19...

How do I allow users to dial numbers in my tableView cells?

Hi all, I have a table containing cells with phone numbers. How can I allow the user to dial these numbers by tapping the cell? It's not working by default and there's no option in interface builder like there is for uiwebviews so I imagine I need to programmatically tell the app to dial the number when the cell is tapped. ...

Call method with parameters after animation completion

I want to call a method with certain parameters once an animation is done. The flow is something like this: -(void) myMethod:(int)val { [self performAnimation]; [self doSomethingElse:val]; // This should be done after animation completion } I presume the 'doSomethingElse' method needs to be called from the method defined in '...

Why are my "tel:" links not working

I have a tableView which has cells with phone numbers. The app is not dialing the numbers though. See the code below - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 2) { UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath]; NSString *num...

Prevent status bar from receiving touch events

Edit After further testing, it appears that the part of my button that are not clickable are where the status bar used to be. I'm hiding the status bar with : // -- Override point for customization after app launch [[UIApplication sharedApplication] setStatusBarHidden:YES]; Also added the Boolean value to my *-info.plist file: U...

How to use generic (NSObject) controller with subviews of a UIViewController?

I have a UIViewController that is loading several subviews at different times based on user interaction. I originally built all of these subviews in code, with no nib files. Now I am moving to nib files with custom UIView subclasses. Some of these subviews display static data, and I am using loadNibNamed:owner:options: to load them int...

Problem with NSUserDefaults and deallocated Instance

Hi, I'm having a problem with NSUserDefaults. I've followed the steps in the books as closely as I can for my app, but still get the same problem. I am getting a *** -[NSUserDefaults integerForKey:]: message sent to deallocated instance 0x3b375a0 error when I try and load in the settings. Here is the code that I have, it is in the...

How to find undocumented iPhone API calls?

In the early days of the iPhone development apps are often kicked out of the AppStore for using undocumented API calls. I always asked myself how people found out about these methods and what they do. I know a little about Objective-C and I know you can send any message to any object or you can even check if an object will answer to a me...

UINavigation/TabBar transition animation

How can I use UIViewAnimationTransition type in one of UINavigation/TabBar transitions? thanks ...