iphone

Exception When Setting the Nib Name field in Interface Builder

Hey Guys, I'm trying to load a view controller from a nib in Interface Builder. My basic setup is this: MainWindow.xib contains: All the usual stuff, the app delegate instance, the Window etc. A UINavigationController which has a UIViewController as it's Root View Controller. The nib name of the UIViewController is set to the name of ...

Last row in UITableView is obscured by UITabBar

I have a UITabBarController that has a list of UINavigationControllers assigned to the 'viewControllers' property. Each UINavigationController has a custom UIViewController as its 'rootController' and this custom UIViewController loads its 'view' from a .xib file. This 'view' contains a UITableView (and some other controls that are disp...

handling a fatal error in iphone app

how to handle error in an iphone app ? log and exit ? show an alert dialog and exit ? for exemple, if an image is missing from the bundle..even though it should not ... ...

iPhone: How to load a View using a nib file created with Interface Builder

Hi I'm trying to do something a bit elaborate but that should be possible, so here is a challenge for all you experts out there (this forum is pack of the lot of you :) ). Im creating a Questionnaire "component" I want to load on a NavigationContoller my QuestionManagerViewController. This is an "empty" view controller that can load di...

Stop UITextView from jumping when programatically setting text

Hi there, I have to update a small amount of text in a scrolling UITextView. I'll only be inserting a character where the cursor currently is, and I'll be doing this on a press of a button on my navigation bar. My problem is that whenever I call the setText method of the text view, it jumps to the bottom of the text. I've tried using c...

How do I create a UIBarButtonItem with multiple "sections"?

I would like to create a UIBarButtonItem on my iPhone application which has two "sections". Basically I would like to have functionality equivalent to the 'Today', 'This Week', and 'All' buttons that's in the 'Most Viewed' section of the YouTube iPhone app. It doesn't look like this functionality was accomplished with multiple UIBarBu...

Adding RSA keys to the iPhone keychain

Hello everyone, I'm trying to add a public and private RSA keys to the iPhone's keychain, so I can use the CommonCrypto library, but am not entirely sure how to do that. The MYCrypto library seems to only work for the Mac and not the iPhone right now. Can anyone help and explain how to add a private/public key to the keychain and get a ...

Iphone App Installation Error

Hello, I am trying to install an application on my iphone for testing. I have installed projects on the phone before. The project compiles and links fine, but when xCode tries to install my app on the phone I get the error: Xcode has encountered an unexpected error (0xE800003A) 0xE800003A, at '/SourceCache/iPhoneXcodePlugin/iPhoneXc...

Is there an easy way of sorting a plist (array of dictionaries) by key value?

I need to reorder a plist (an array of dictonaries) by Key value. In this example content I'd like to order by the value for the key Name (Matt, Joe): <dict> <key>Name</key> <string>Matt</string> <key>Details</key> <string>Me</string> </dict> <dict> <key>Name</key> <string>Joe</string> <key>Details</key> ...

Conditional compile when running in Simulator as opposed to on a device

Is there a compiler directive I can use to compile a different line of code when targetting the simulator as opposed to my device. Something like: # IF SIMULATOR [self.imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary]; # ELSE [self.imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera]; # END EDIT D...

How to put an image as the navigation bar title

Hello, I want to put a .png image in the middle of the navigation bar instead of the title written in text. Could you please let me know how to do that? Thanks. ...

iPhone SDK: Checking the ID number for each object in a UITableView and change the badge number accordingly

Hello there! I'm tryin to use some code to create a badge number for the iPhone App Icon. I can successfully do this, however the code I am using (below) is pretty bad and could easily be done better, however I do not have the logic knowledge to be able to do this. This is what it's doing... Get's the 'ID' of a user from the first me...

Custom UIPageControl view, replacing dots with "Page X of Y"

Hello. I'm trying to find a way to replace the dots of a UIPageControl with a caption that reads "Page X of Y" since I'll likely have >50 items. I'm just becoming familiar with Cocoa, and I was wondering what is the best way to do this. Can I subclass UIPageControl? Should I use a custom view with labels? Or something else? Thanks in a...

What kind of data is size_t holding?

In a code-snippet I have seen this: size_t w = CGImageGetWidth(inImage); The docs don't give me any useful info about "size_t". Does anyone know what this is? ...

What's this {{0,0},{w,h}} doing?

I stumbled upon this piece of code today: CGRect rect = {{0,0},{w,h}}; Here, I would have used a CGRectMake. But what does this thing in rambled brackets do? What kind of special-syntax is that? None of my objective-c books ever mentioned that. ...

UIView: how to do non-destructive drawing?

My original question: I'm creating a simple drawing application and need to be able to draw over existing, previously drawn content in my drawRect. What is the proper way to draw on top of existing content without entirely replacing it? Based on answers received here and elsewhere, here is the deal. You should be prep...

Understanding Objective c enum declaration

From iPhone UIControl UIControlEventAllTouchEvents = 0x00000FFF, UIControlEventAllEditingEvents = 0x000F0000, UIControlEventApplicationReserved = 0x0F000000, UIControlEventSystemReserved = 0xF0000000, UIControlEventAllEvents = 0xFFFFFFFF Now I assume the UIControlEventApplication is the 'range' I can use to spe...

Change uitablelview properties in subclass in viewdownload method in cocoa?

I've been following a tutorial that manipulates a uitableview from a uiviewcontroller to generate nicely styled cells. I was wondering is it possible to do same to a class that subclasses uitablewcontroller instead of uiviewcontroller. The user uses code like: tableView.rowHeight = 50; tableView.backgroundColor = [UIColor clearC...

How can I find out how many bytes one pixel has in an CGImageRef?

The doc is mentioning an CGBitmapContextGetBitsPerPixel(). I am almost sure that I would just have to divide this by 8. But since I didnt study computer science, I am confused about the detail. Would it make a difference if it's an 8 bit PNG or 24 bit PNG? Or some other PNG? So to get securely the bytes per pixel of an CGContextRef, wo...

Getting UUID through SDK

Does the SDK provide an API for retrieving the current phone's UUID? ...