Tag: iphone

How do I share an object between UIViewControllers on iPhone?

My application is a tab bar application, with a separate view controller for each tab. I have an object in my first view controller (A) which contains all my stored application data (Please ignore NSUserDefaults for this) which needs to be accessed by the second view controller (B) when I press a button on it. […]

The entitlements specified…profile. (0xE8008016). Error iOS 4.2

I am getting the ‘dreaded’ error The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile. (0xE8008016). when trying to deploy my first app to an un-jailbroken device on iOS 4.2.6 (Verizon). The thing is, I do not have a Entitlements file in my project, as […]

Convert Seconds Integer To HH:MM, iPhone

I am struggling with this. I have a value in seconds that I want to display in a label in HH:MM format. I have searched the internet for ages and found some answers, but either not fully understood them, or they seem like an odd way of doing what I want. If someone could help […]

Can I access the keychain on the iPhone?

This question discusses encrypting data on the iPhone using the crypt() function. As an alternative, is there a keychain on the iPhone and if so, what code would I use to access it in order to store login details and then retrieve them for us in an application?

Add UIView Above All Other Views, Including StatusBar

I’m wanting to create a view (UIControl) which blocks all input and shows a UIActivityIndicatorView while authenticating a user. The UIActionSheet and UIAlertView both manage to add a black semi-transparent view over the top of all other views to block input and I’d like to do similar. I’ve tried adding my view to the top […]

iPhone – dequeueReusableCellWithIdentifier usage

I’m working on a iPhone app which has a pretty large UITableView with data taken from the web, so I’m trying to optimize its creation and usage. I found out that dequeueReusableCellWithIdentifier is pretty useful, but after seeing many source codes using this, I’m wondering if the usage I make of this function is the […]

CALayer: add a border only at one side

I can add a border to a CALayer in this way: [webView.layer setBorderColor: [[UIColor colorWithRed:0.6 green:0.7 blue:0.2 alpha:1] CGColor]]; [webView.layer setBorderWidth: 2.75]; But is it possible to add a border only at one side? I only need a border at the bottom. Or can I reach this with other properties, e.g. frame, bounds, mask, …? […]

Pixel Width of the text in a UILabel

I need to draw a UILabel striked through. Therefore I subclassed UILabel and implemented it as follows: @implementation UIStrikedLabel – (void)drawTextInRect:(CGRect)rect{ [super drawTextInRect:rect]; CGContextRef context = UIGraphicsGetCurrentContext(); CGContextFillRect(context,CGRectMake(0,rect.size.height/2,rect.size.width,1)); } @end What happens is that the the UILabel is striked through with a line being as long as the whole label, but the text can be […]

Best Cocoa/Objective-C Wrapper Library for SQLite on iPhone

I’m developing for the iPhone and am looking for a good Cocoa/Objective-C library for working with SQLite. I don’t want to use the standard procedural SQLite C API. I see options at sqlite.org under the Objective-C section, but am not sure which is the best in terms of library API design, stability, and functionality. I’d […]

iOS 5 does not allow to store downloaded data in Documents directory?

I have made an application for my client by keeping target iOS as 4. But since the application still not submitted to Apple store, my client is planning to upgrade it for iOS 5.0. For this I read the guideline from Apple and found that “Only user-generated data or that cannot otherwise be recreated by […]